explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AueX

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 860.623 ↑ 1.0 10 1

Limit (cost=328,056.02..328,056.05 rows=10 width=75) (actual time=860.621..860.623 rows=10 loops=1)

  • Planning time: 0.413 ms
  • Execution time: 860.686 ms
2. 0.267 860.619 ↑ 63.1 10 1

Sort (cost=328,056.02..328,057.60 rows=631 width=75) (actual time=860.619..860.619 rows=10 loops=1)

  • Sort Key: deals.total_price, deals.updated_ts DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 622.551 860.352 ↓ 1.0 633 1

Bitmap Heap Scan on deals (cost=46,325.35..328,042.39 rows=631 width=75) (actual time=268.560..860.352 rows=633 loops=1)

  • Recheck Cond: ((departure_date IS NOT NULL) AND (departure_date > (('now'::cstring)::date + '1 day'::interval)) AND (departure_date < (('now'::cstring)::date + '15 days'::interval)) AND (return_date IS NULL))
  • Filter: ((((from_city)::text = 'Toronto'::text) OR ((from_country)::text = 'Toronto'::text)) AND (((to_city)::text = 'Vancouver'::text) OR ((to_country)::text = 'Vancouver'::text)))
  • Rows Removed by Filter: 1691785
  • Heap Blocks: exact=114742
4. 237.801 237.801 ↓ 1.4 1,692,418 1

Bitmap Index Scan on idx_departure_date_return_date (cost=0.00..46,325.19 rows=1,252,501 width=0) (actual time=237.801..237.801 rows=1,692,418 loops=1)

  • Index Cond: ((departure_date IS NOT NULL) AND (departure_date > (('now'::cstring)::date + '1 day'::interval)) AND (departure_date < (('now'::cstring)::date + '15 days'::interval)) AND (return_date IS NULL))