explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3kbr

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 427.773 ↓ 3.7 11 1

Sort (cost=138,204.86..138,204.87 rows=3 width=40) (actual time=427.772..427.773 rows=11 loops=1)

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

CTE first_event

3. 226.041 403.944 ↑ 100.0 38,773 1

ProjectSet (cost=10,839.21..31,579.55 rows=3,876,700 width=59) (actual time=136.145..403.944 rows=38,773 loops=1)

4. 20.461 177.903 ↓ 1.0 38,773 1

WindowAgg (cost=10,839.21..11,711.47 rows=38,767 width=321) (actual time=136.125..177.903 rows=38,773 loops=1)

5. 150.116 157.442 ↓ 1.0 38,773 1

Sort (cost=10,839.21..10,936.13 rows=38,767 width=313) (actual time=136.113..157.442 rows=38,773 loops=1)

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

Seq Scan on demuxed_events de_1 (cost=0.00..2,186.67 rows=38,767 width=313) (actual time=0.007..7.326 rows=38,773 loops=1)

7. 0.039 427.765 ↓ 3.7 11 1

Nested Loop (cost=4.32..106,625.29 rows=3 width=40) (actual time=243.500..427.765 rows=11 loops=1)

8. 427.699 427.699 ↑ 1.0 1 1

CTE Scan on first_event fe (cost=0.00..106,609.25 rows=1 width=118) (actual time=243.461..427.699 rows=1 loops=1)

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

Bitmap Heap Scan on demuxed_events de (cost=4.32..16.00 rows=3 width=309) (actual time=0.025..0.027 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.387 ms
Execution time : 430.796 ms