explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Kk8

Settings
# exclusive inclusive rows x rows loops node
1. 41.962 345.709 ↑ 70.6 75,960 1

Merge Right Join (cost=16,069.65..96,565.23 rows=5,360,965 width=20) (actual time=275.624..345.709 rows=75,960 loops=1)

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

CTE user_last_saved_listing_at

3. 8.311 9.296 ↓ 1.0 16,223 1

Bitmap Heap Scan on user_events (cost=370.14..2,343.92 rows=16,222 width=12) (actual time=1.179..9.296 rows=16,223 loops=1)

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

Bitmap Index Scan on user_events_event_type_idx (cost=0.00..366.08 rows=16,222 width=0) (actual time=0.985..0.985 rows=16,235 loops=1)

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

CTE user_last_seen_at

6. 122.166 176.736 ↓ 1.1 75,960 1

HashAggregate (cost=4,992.41..5,653.36 rows=66,095 width=12) (actual time=146.951..176.736 rows=75,960 loops=1)

  • Group Key: user_events_1.user_id
7. 54.570 54.570 ↓ 1.0 214,770 1

Seq Scan on user_events user_events_1 (cost=0.00..3,918.61 rows=214,761 width=12) (actual time=0.011..54.570 rows=214,770 loops=1)

8. 10.868 29.250 ↓ 1.0 16,223 1

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

  • Sort Key: b.user_id
  • Sort Method: quicksort Memory: 1145kB
9. 18.382 18.382 ↓ 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.182..18.382 rows=16,223 loops=1)

10. 56.434 274.497 ↓ 1.1 75,960 1

Sort (cost=6,613.55..6,778.79 rows=66,095 width=12) (actual time=250.737..274.497 rows=75,960 loops=1)

  • Sort Key: a.user_id
  • Sort Method: quicksort Memory: 6292kB
11. 218.063 218.063 ↓ 1.1 75,960 1

CTE Scan on user_last_seen_at a (cost=0.00..1,321.90 rows=66,095 width=12) (actual time=146.954..218.063 rows=75,960 loops=1)