explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QrOH

Settings
# exclusive inclusive rows x rows loops node
1. 44.726 462.792 ↑ 70.6 75,956 1

Merge Right Join (cost=23,243.31..103,738.90 rows=5,360,965 width=20) (actual time=394.963..462.792 rows=75,956 loops=1)

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

CTE user_last_saved_listing_at

3. 8.269 9.308 ↓ 1.0 16,223 1

Bitmap Heap Scan on user_events (cost=366.14..2,339.92 rows=16,222 width=12) (actual time=1.241..9.308 rows=16,223 loops=1)

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

Bitmap Index Scan on user_events_event_type_idx (cost=0.00..362.08 rows=16,222 width=0) (actual time=1.039..1.039 rows=16,224 loops=1)

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

CTE user_last_seen_at

6. 101.411 220.846 ↓ 1.1 75,956 1

GroupAggregate (cost=0.42..12,831.03 rows=66,095 width=12) (actual time=0.015..220.846 rows=75,956 loops=1)

  • Group Key: user_events_1.user_id
7. 119.435 119.435 ↑ 1.0 214,761 1

Index Scan using user_events_user_id_idx on user_events user_events_1 (cost=0.42..11,096.27 rows=214,761 width=12) (actual time=0.008..119.435 rows=214,761 loops=1)

8. 10.921 33.296 ↓ 1.0 16,223 1

Sort (cost=1,458.82..1,499.37 rows=16,222 width=12) (actual time=29.024..33.296 rows=16,223 loops=1)

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

CTE Scan on user_last_saved_listing_at b (cost=0.00..324.44 rows=16,222 width=12) (actual time=1.244..22.375 rows=16,223 loops=1)

10. 77.372 384.770 ↓ 1.1 75,956 1

Sort (cost=6,613.55..6,778.79 rows=66,095 width=12) (actual time=365.933..384.770 rows=75,956 loops=1)

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

CTE Scan on user_last_seen_at a (cost=0.00..1,321.90 rows=66,095 width=12) (actual time=0.016..307.398 rows=75,956 loops=1)

Planning time : 0.171 ms
Execution time : 481.521 ms