explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RPNV : Booking where customer exists

Settings
# exclusive inclusive rows x rows loops node
1. 1,655.052 25,606.227 ↑ 7.8 61,695 1

Seq Scan on booking (cost=0.00..42,716,021.74 rows=478,187 width=270) (actual time=0.167..25,606.227 rows=61,695 loops=1)

  • Filter: (((reference_number)::text = '9999999999'::text) OR ((booking_id)::text = '9999999999'::text) OR (SubPlan 1))
  • Rows Removed by Filter: 896353
  • Buffers: shared hit=4347028
2.          

SubPlan (for Seq Scan)

3. 23,951.175 23,951.175 ↓ 0.0 0 958,047

Index Scan using book_cust_idx on booking_customer (cost=0.43..44.61 rows=1 width=0) (actual time=0.025..0.025 rows=0 loops=958,047)

  • Index Cond: ((booking_id)::text = (booking.booking_id)::text)
  • Filter: ((NOT deleted) AND (((email)::text = '9999999999'::text) OR ((phone)::text = '9999999999'::text)))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=4310578
Planning time : 0.369 ms
Execution time : 25,614.113 ms