explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JZgE

Settings
# exclusive inclusive rows x rows loops node
1. 6.175 89.450 ↑ 1.4 10,776 1

Sort (cost=28,560.44..28,597.64 rows=14,882 width=341) (actual time=88.801..89.450 rows=10,776 loops=1)

  • Sort Key: casual_days_sums.casual_insurance_days_left
  • Sort Method: quicksort Memory: 3647kB
2. 5.130 83.275 ↑ 1.4 10,776 1

Hash Right Join (cost=22,870.91..25,187.52 rows=14,882 width=341) (actual time=78.009..83.275 rows=10,776 loops=1)

  • Hash Cond: (casual_days_sums.id = bookings.rv_id)
3. 0.047 30.303 ↑ 5.0 709 1

Subquery Scan on casual_days_sums (cost=10,869.29..10,948.51 rows=3,521 width=12) (actual time=30.151..30.303 rows=709 loops=1)

4. 0.697 30.256 ↑ 5.0 709 1

HashAggregate (cost=10,869.29..10,913.31 rows=3,521 width=8) (actual time=30.150..30.256 rows=709 loops=1)

  • Group Key: rvs_1.id
5. 1.054 29.559 ↑ 2.2 1,920 1

Hash Join (cost=943.98..10,837.08 rows=4,295 width=8) (actual time=4.370..29.559 rows=1,920 loops=1)

  • Hash Cond: (bookings_1.rv_id = rvs_1.id)
6. 24.162 24.162 ↑ 1.8 4,810 1

Seq Scan on bookings bookings_1 (cost=0.00..9,817.60 rows=8,682 width=8) (actual time=0.017..24.162 rows=4,810 loops=1)

  • 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))))
  • Rows Removed by Filter: 117941
7. 0.360 4.343 ↓ 1.0 3,522 1

Hash (cost=899.96..899.96 rows=3,521 width=4) (actual time=4.343..4.343 rows=3,522 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 156kB
8. 3.983 3.983 ↓ 1.0 3,522 1

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

  • Filter: (camplify_insurance = 2)
  • Rows Removed by Filter: 3595
9. 7.487 47.842 ↑ 1.4 10,776 1

Hash (cost=11,161.59..11,161.59 rows=14,882 width=333) (actual time=47.842..47.842 rows=10,776 loops=1)

  • Buckets: 16384 Batches: 2 Memory Usage: 1441kB
10. 6.013 40.355 ↑ 1.4 10,776 1

Hash Join (cost=978.61..11,161.59 rows=14,882 width=333) (actual time=6.309..40.355 rows=10,776 loops=1)

  • Hash Cond: (bookings.rv_id = rvs.id)
11. 28.056 28.056 ↑ 1.5 11,010 1

Seq Scan on bookings (cost=0.00..9,971.03 rows=16,833 width=333) (actual time=0.013..28.056 rows=11,010 loops=1)

  • Filter: ((status = ANY ('{2,4,5}'::integer[])) AND (((start_date >= '2018-09-05 20:41:14.949789'::timestamp without time zone) AND (start_date <= '2019-09-05 00:00:00'::timestamp without time zone)) OR ((end_date >= '2018-09-05 20:41:14.949789'::timestamp without time zone) AND (end_date <= '2019-09-05 00:00:00'::timestamp without time zone)) OR ((start_date < '2018-09-05 20:41:14.949789'::timestamp without time zone) AND (end_date > '2019-09-05 00:00:00'::timestamp without time zone))))
  • Rows Removed by Filter: 111741
12. 0.740 6.286 ↑ 1.2 5,207 1

Hash (cost=899.96..899.96 rows=6,292 width=4) (actual time=6.286..6.286 rows=5,207 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 248kB
13. 5.546 5.546 ↑ 1.2 5,207 1

Seq Scan on rvs (cost=0.00..899.96 rows=6,292 width=4) (actual time=0.015..5.546 rows=5,207 loops=1)

  • Filter: ((camplify_insurance <> ALL ('{0,1}'::integer[])) OR (insurance_product_id IS NOT NULL))
  • Rows Removed by Filter: 1910
Planning time : 0.689 ms
Execution time : 89.835 ms