explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eU5g

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 637.960 ↓ 3.7 11 1

Sort (cost=138,092.25..138,092.26 rows=3 width=40) (actual time=637.958..637.960 rows=11 loops=1)

  • Sort Key: de.event_timestamp
  • Sort Method: quicksort Memory: 28kB
2.          

CTE first_event

3. 324.474 606.469 ↑ 100.0 38,753 1

ProjectSet (cost=10,831.72..31,554.94 rows=3,873,500 width=59) (actual time=213.703..606.469 rows=38,753 loops=1)

4. 38.406 281.995 ↓ 1.0 38,753 1

WindowAgg (cost=10,831.72..11,703.26 rows=38,735 width=321) (actual time=213.680..281.995 rows=38,753 loops=1)

5. 231.084 243.589 ↓ 1.0 38,753 1

Sort (cost=10,831.72..10,928.56 rows=38,735 width=313) (actual time=213.663..243.589 rows=38,753 loops=1)

  • Sort Key: de_1.event_id, de_1.type, de_1.event_timestamp
  • Sort Method: external merge Disk: 12,440kB
6. 12.505 12.505 ↓ 1.0 38,753 1

Seq Scan on demuxed_events de_1 (cost=0.00..2,185.35 rows=38,735 width=313) (actual time=0.008..12.505 rows=38,753 loops=1)

7. 0.044 637.949 ↓ 3.7 11 1

Nested Loop (cost=4.32..106,537.29 rows=3 width=40) (actual time=411.463..637.949 rows=11 loops=1)

8. 637.877 637.877 ↑ 1.0 1 1

CTE Scan on first_event fe (cost=0.00..106,521.25 rows=1 width=118) (actual time=411.422..637.877 rows=1 loops=1)

  • Filter: (((event_id)::text = '107502706'::text) AND (rk = 1) AND (name = 'packageCreated'::text))
  • Rows Removed by Filter: 38,752
9. 0.008 0.028 ↓ 3.7 11 1

Bitmap Heap Scan on demuxed_events de (cost=4.32..16.00 rows=3 width=309) (actual time=0.026..0.028 rows=11 loops=1)

  • Recheck Cond: ((type = 'package'::aggregate_root_entity_type) AND ((event_id)::text = '107502706'::text))
  • Heap Blocks: exact=2
10. 0.020 0.020 ↓ 3.7 11 1

Bitmap Index Scan on type_and_event_id (cost=0.00..4.32 rows=3 width=0) (actual time=0.020..0.020 rows=11 loops=1)

  • Index Cond: ((type = 'package'::aggregate_root_entity_type) AND ((event_id)::text = '107502706'::text))
Planning time : 0.150 ms
Execution time : 641.346 ms