explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6qqZ

Settings
# exclusive inclusive rows x rows loops node
1. 39.781 396.685 ↑ 70.6 75,955 1

Merge Right Join (cost=23,242.66..103,729.65 rows=5,360,392 width=20) (actual time=334.055..396.685 rows=75,955 loops=1)

  • Merge Cond: (b.user_id = a.user_id)
2.          

CTE user_last_saved_listing_at

3. 8.261 9.225 ↓ 1.0 16,223 1

Bitmap Heap Scan on user_events (cost=366.13..2,339.90 rows=16,221 width=12) (actual time=1.157..9.225 rows=16,223 loops=1)

  • Recheck Cond: (event_type = 'saved_listing'::text)
  • Heap Blocks: exact=1716
4. 0.964 0.964 ↓ 1.0 16,223 1

Bitmap Index Scan on user_events_event_type_idx (cost=0.00..362.08 rows=16,221 width=0) (actual time=0.964..0.964 rows=16,223 loops=1)

  • Index Cond: (event_type = 'saved_listing'::text)
5.          

CTE user_last_seen_at

6. 89.135 207.862 ↓ 1.1 75,955 1

GroupAggregate (cost=0.42..12,830.82 rows=66,092 width=12) (actual time=0.018..207.862 rows=75,955 loops=1)

  • Group Key: user_events_1.user_id
7. 118.727 118.727 ↓ 1.0 214,758 1

Index Scan using user_events_user_id_idx on user_events user_events_1 (cost=0.42..11,096.14 rows=214,752 width=12) (actual time=0.010..118.727 rows=214,758 loops=1)

8. 10.851 29.197 ↓ 1.0 16,223 1

Sort (cost=1,458.72..1,499.27 rows=16,221 width=12) (actual time=24.922..29.197 rows=16,223 loops=1)

  • Sort Key: b.user_id
  • Sort Method: quicksort Memory: 1145kB
9. 18.346 18.346 ↓ 1.0 16,223 1

CTE Scan on user_last_saved_listing_at b (cost=0.00..324.42 rows=16,221 width=12) (actual time=1.159..18.346 rows=16,223 loops=1)

10. 72.397 327.707 ↓ 1.1 75,955 1

Sort (cost=6,613.23..6,778.46 rows=66,092 width=12) (actual time=309.127..327.707 rows=75,955 loops=1)

  • Sort Key: a.user_id
  • Sort Method: external sort Disk: 2232kB
11. 255.310 255.310 ↓ 1.1 75,955 1

CTE Scan on user_last_seen_at a (cost=0.00..1,321.84 rows=66,092 width=12) (actual time=0.020..255.310 rows=75,955 loops=1)

Planning time : 0.171 ms
Execution time : 411.251 ms