explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nSYc : JOIN for smaller matched record

Settings
# exclusive inclusive rows x rows loops node
1. 0.246 6,952.896 ↑ 2.1 481 1

Unique (cost=360,673.77..360,684.05 rows=1,028 width=270) (actual time=6,952.523..6,952.896 rows=481 loops=1)

  • Buffers: shared hit=138,928, temp read=49,221 written=48,967
2. 1.594 6,952.650 ↑ 1.7 590 1

Sort (cost=360,673.77..360,676.34 rows=1,028 width=270) (actual time=6,952.522..6,952.650 rows=590 loops=1)

  • Sort Key: booking.checkin_date, booking.created_at DESC, booking.booking_id
  • Sort Method: quicksort Memory: 238kB
  • Buffers: shared hit=138,928, temp read=49,221 written=48,967
3. 3,880.849 6,951.056 ↑ 1.7 590 1

Hash Join (cost=92,525.39..360,622.34 rows=1,028 width=270) (actual time=2,171.034..6,951.056 rows=590 loops=1)

  • Hash Cond: ((booking_customer.booking_id)::text = (booking.booking_id)::text)
  • Join Filter: (((booking.reference_number)::text = '99999'::text) OR ((booking.booking_id)::text = '99999'::text) OR ((booking_customer.email)::text = '99999'::text) OR ((booking_customer.phone)::text = '99999'::text))
  • Rows Removed by Join Filter: 2,299,087
  • Buffers: shared hit=138,928, temp read=49,221 written=48,967
4. 1,190.441 1,190.441 ↓ 1.0 2,457,931 1

Seq Scan on booking_customer (cost=0.00..127,199.20 rows=2,456,958 width=49) (actual time=0.005..1,190.441 rows=2,457,931 loops=1)

  • Filter: (NOT deleted)
  • Rows Removed by Filter: 14,205
  • Buffers: shared hit=102,478
5. 1,197.479 1,879.766 ↓ 1.0 958,429 1

Hash (cost=46,013.73..46,013.73 rows=956,373 width=270) (actual time=1,879.766..1,879.766 rows=958,429 loops=1)

  • Buckets: 16,384 Batches: 128 Memory Usage: 2,239kB
  • Buffers: shared hit=36,450, temp written=31,865
6. 682.287 682.287 ↓ 1.0 958,429 1

Seq Scan on booking (cost=0.00..46,013.73 rows=956,373 width=270) (actual time=0.005..682.287 rows=958,429 loops=1)

  • Filter: (NOT deleted)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=36,450
Planning time : 0.775 ms
Execution time : 6,953.309 ms