explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B1a4

Settings
# exclusive inclusive rows x rows loops node
1. 0.356 1,863.194 ↑ 3,496.2 474 1

Sort (cost=1,035,824.04..1,039,966.98 rows=1,657,177 width=151) (actual time=1,863.163..1,863.194 rows=474 loops=1)

  • Sort Key: vs.creation_time DESC, vs.id DESC
  • Sort Method: quicksort Memory: 94kB
2. 1.170 1,862.838 ↑ 3,496.2 474 1

Merge Join (cost=332,098.55..615,407.20 rows=1,657,177 width=151) (actual time=1,861.486..1,862.838 rows=474 loops=1)

  • Merge Cond: (v.id = vs.vehicle_id)
3. 0.428 1.153 ↑ 2.1 3,550 1

Merge Append (cost=1.48..1,461.38 rows=7,546 width=4) (actual time=0.055..1.153 rows=3,550 loops=1)

  • Sort Key: v.id
4. 0.003 0.003 ↓ 0.0 0 1

Index Only Scan using vehicle_pkey on vehicle v (cost=0.12..8.14 rows=1 width=4) (actual time=0.002..0.003 rows=0 loops=1)

  • Heap Fetches: 0
5. 0.043 0.043 ↑ 1.2 159 1

Index Only Scan using vehicle_be_pkey on vehicle v_1 (cost=0.14..22.66 rows=198 width=4) (actual time=0.009..0.043 rows=159 loops=1)

  • Heap Fetches: 17
6. 0.176 0.176 ↑ 1.6 643 1

Index Only Scan using vehicle_de_pkey on vehicle v_2 (cost=0.28..344.19 rows=1,031 width=4) (actual time=0.006..0.176 rows=643 loops=1)

  • Heap Fetches: 59
7. 0.369 0.369 ↑ 2.4 2,328 1

Index Only Scan using vehicle_fr_pkey on vehicle v_3 (cost=0.28..724.07 rows=5,586 width=4) (actual time=0.013..0.369 rows=2,328 loops=1)

  • Heap Fetches: 69
8. 0.036 0.036 ↑ 3.0 155 1

Index Only Scan using vehicle_it_pkey on vehicle v_4 (cost=0.27..111.20 rows=462 width=4) (actual time=0.005..0.036 rows=155 loops=1)

  • Heap Fetches: 4
9. 0.011 0.011 ↑ 1.0 11 1

Index Only Scan using vehicle_lu_pkey on vehicle v_5 (cost=0.14..8.30 rows=11 width=4) (actual time=0.006..0.011 rows=11 loops=1)

  • Heap Fetches: 0
10. 0.087 0.087 ↑ 1.0 257 1

Index Only Scan using vehicle_uk_pkey on vehicle v_6 (cost=0.15..12.00 rows=257 width=4) (actual time=0.012..0.087 rows=257 loops=1)

  • Heap Fetches: 170
11. 0.086 1,860.515 ↑ 92.7 474 1

Materialize (cost=332,097.06..332,316.67 rows=43,922 width=79) (actual time=1,860.345..1,860.515 rows=474 loops=1)

12. 0.381 1,860.429 ↑ 92.7 474 1

Sort (cost=332,097.06..332,206.87 rows=43,922 width=79) (actual time=1,860.338..1,860.429 rows=474 loops=1)

  • Sort Key: vs.vehicle_id
  • Sort Method: quicksort Memory: 91kB
13. 4.836 1,860.048 ↑ 92.7 474 1

Hash Join (cost=64.18..326,757.09 rows=43,922 width=79) (actual time=148.413..1,860.048 rows=474 loops=1)

  • Hash Cond: (vs.parking_id = reservation_agreement_parking.parking_id)
14. 3.668 1,855.127 ↑ 2.2 39,640 1

Append (cost=0.00..326,240.52 rows=87,844 width=79) (actual time=0.028..1,855.127 rows=39,640 loops=1)

15. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on vehicle_slot vs (cost=0.00..0.00 rows=1 width=659) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
16. 81.273 81.273 ↑ 9.1 4,560 1

Seq Scan on vehicle_slot vs_1 (cost=0.00..12,268.56 rows=41,422 width=79) (actual time=0.026..81.273 rows=4,560 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 368227
17. 505.884 505.884 ↓ 2.5 14,616 1

Seq Scan on vehicle_slot vs_2 (cost=0.00..83,781.39 rows=5,866 width=79) (actual time=0.020..505.884 rows=14,616 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 2525045
18. 1,032.614 1,032.614 ↓ 1.2 18,317 1

Seq Scan on vehicle_slot vs_3 (cost=0.00..187,404.85 rows=15,851 width=79) (actual time=0.035..1,032.614 rows=18,317 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 5664978
19. 194.507 194.507 ↓ 2.3 1,597 1

Seq Scan on vehicle_slot vs_4 (cost=0.00..35,653.24 rows=684 width=79) (actual time=0.025..194.507 rows=1,597 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 1077765
20. 2.080 2.080 ↑ 97.7 14 1

Seq Scan on vehicle_slot vs_5 (cost=0.00..406.50 rows=1,368 width=79) (actual time=0.032..2.080 rows=14 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 12300
21. 35.099 35.099 ↑ 42.3 536 1

Seq Scan on vehicle_slot vs_6 (cost=0.00..6,725.99 rows=22,652 width=79) (actual time=0.013..35.099 rows=536 loops=1)

  • Filter: ((start_time < COALESCE(end_time, 'infinity'::timestamp with time zone)) AND (COALESCE(end_time, 'infinity'::timestamp with time zone) >= '2020-05-19 16:19:12+00'::timestamp with time zone) AND (start_time <= '2020-05-19 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 203349
22. 0.004 0.085 ↑ 1.5 19 1

Hash (cost=63.83..63.83 rows=28 width=4) (actual time=0.085..0.085 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.009 0.081 ↑ 1.5 19 1

HashAggregate (cost=63.55..63.83 rows=28 width=4) (actual time=0.080..0.081 rows=19 loops=1)

  • Group Key: reservation_agreement_parking.parking_id
24. 0.005 0.072 ↓ 1.3 36 1

Append (cost=0.00..63.48 rows=28 width=4) (actual time=0.027..0.072 rows=36 loops=1)

25. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on reservation_agreement_parking (cost=0.00..0.00 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
26. 0.006 0.006 ↓ 0.0 0 1

Index Only Scan using reservation_agreement_parking_be_pkey on reservation_agreement_parking reservation_agreement_parking_1 (cost=0.28..8.60 rows=3 width=4) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Heap Fetches: 0
27. 0.018 0.033 ↓ 4.0 36 1

Bitmap Heap Scan on reservation_agreement_parking reservation_agreement_parking_2 (cost=8.62..23.76 rows=9 width=4) (actual time=0.020..0.033 rows=36 loops=1)

  • Recheck Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Heap Blocks: exact=6
28. 0.015 0.015 ↓ 4.0 36 1

Bitmap Index Scan on reservation_agreement_parking_de_pkey (cost=0.00..8.62 rows=9 width=0) (actual time=0.014..0.015 rows=36 loops=1)

  • Index Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
29. 0.007 0.007 ↓ 0.0 0 1

Index Only Scan using reservation_agreement_parking_fr_pkey on reservation_agreement_parking reservation_agreement_parking_3 (cost=0.28..12.64 rows=5 width=4) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Heap Fetches: 0
30. 0.007 0.007 ↓ 0.0 0 1

Index Only Scan using reservation_agreement_parking_it_pkey on reservation_agreement_parking reservation_agreement_parking_4 (cost=0.28..8.59 rows=2 width=4) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Heap Fetches: 0
31. 0.008 0.008 ↓ 0.0 0 1

Seq Scan on reservation_agreement_parking reservation_agreement_parking_5 (cost=0.00..1.23 rows=2 width=4) (actual time=0.008..0.008 rows=0 loops=1)

  • Filter: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Rows Removed by Filter: 18
32. 0.005 0.005 ↓ 0.0 0 1

Index Only Scan using reservation_agreement_parking_uk_pkey on reservation_agreement_parking reservation_agreement_parking_6 (cost=0.28..8.66 rows=6 width=4) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = ANY ('{627,705}'::integer[]))
  • Heap Fetches: 0
Planning time : 2.612 ms
Execution time : 1,863.488 ms