explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mtnm

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=40,533.96..40,571.18 rows=14,891 width=1,608) (actual rows= loops=)

  • Sort Key: ((45 - sum((bookings_1.total_night 1))))
2. 0.000 0.000 ↓ 0.0

Hash Join (cost=23,760.49..29,117.35 rows=14,891 width=1,608) (actual rows= loops=)

  • Hash Cond: (bookings.rv_id = rvs.id)
3. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=21,791.88..24,398.66 rows=16,844 width=345) (actual rows= loops=)

  • Hash Cond: (rvs_1.id = bookings.rv_id)
4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10,869.29..10,913.31 rows=3,521 width=8) (actual rows= loops=)

  • Group Key: rvs_1.id
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=943.98..10,837.08 rows=4,295 width=8) (actual rows= loops=)

  • Hash Cond: (bookings_1.rv_id = rvs_1.id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on bookings bookings_1 (cost=0.00..9,817.60 rows=8,682 width=8) (actual rows= loops=)

  • Filter: ((status = ANY ('{4,5}'::integer[])) AND (((start_date >= '2019-06-30 00:00:00'::timestamp without time zone) AND (start_date <= '2020-06-30 00:00:00'::timestamp without time zone)) OR ((end_date >= '2019-06-30 00:00:00'::timestamp without time zone) AND (end_date <= '2020-06-30 00:00:00'::timestamp without time zone)) OR ((start_date < '2019-06-30 00:00:00'::timestamp without time zone) AND (end_date > '2020-06-30 00:00:00'::timestamp without time zone))))
7. 0.000 0.000 ↓ 0.0

Hash (cost=899.96..899.96 rows=3,521 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on rvs rvs_1 (cost=0.00..899.96 rows=3,521 width=4) (actual rows= loops=)

  • Filter: (camplify_insurance = 2)
9. 0.000 0.000 ↓ 0.0

Hash (cost=9,971.03..9,971.03 rows=16,844 width=333) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on bookings (cost=0.00..9,971.03 rows=16,844 width=333) (actual rows= loops=)

  • Filter: ((status = ANY ('{2,4,5}'::integer[])) AND (((start_date >= '2018-09-05 00:00:00'::timestamp without time zone) AND (start_date <= '2019-09-05 00:00:00'::timestamp without time zone)) OR ((end_date >= '2018-09-05 00:00:00'::timestamp without time zone) AND (end_date <= '2019-09-05 00:00:00'::timestamp without time zone)) OR ((start_date < '2018-09-05 00:00:00'::timestamp without time zone) AND (end_date > '2019-09-05 00:00:00'::timestamp without time zone))))
11. 0.000 0.000 ↓ 0.0

Hash (cost=899.96..899.96 rows=6,292 width=1,263) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on rvs (cost=0.00..899.96 rows=6,292 width=1,263) (actual rows= loops=)

  • Filter: ((camplify_insurance <> ALL ('{0,1}'::integer[])) OR (insurance_product_id IS NOT NULL))