explain.depesz.com

PostgreSQL's explain analyze made readable

Result: niea

Settings
# exclusive inclusive rows x rows loops node
1. 723.217 8,544.355 ↑ 25.5 1,571 1

HashAggregate (cost=36,347,644.32..36,348,044.32 rows=40,000 width=169) (actual time=8,543.941..8,544.355 rows=1,571 loops=1)

  • Group Key: p.id, gs.name
2. 575.623 7,821.138 ↑ 453.7 2,138,101 1

Merge Right Join (cost=14,320,442.93..31,497,292.03 rows=970,070,457 width=169) (actual time=5,894.582..7,821.138 rows=2,138,101 loops=1)

  • Merge Cond: ((prap.perimeter_reservation_agreement_id = pra.id) AND (prap.parking_id = p.id))
3. 24.464 69.689 ↑ 3.1 196,638 1

Merge Append (cost=1.94..40,220.57 rows=616,645 width=8) (actual time=0.063..69.689 rows=196,638 loops=1)

  • Sort Key: prap.perimeter_reservation_agreement_id, prap.parking_id
4. 0.005 0.005 ↓ 0.0 0 1

Index Only Scan using perimeter_reservation_agreement_parking_pkey on perimeter_reservation_agreement_parking prap (cost=0.12..8.14 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=1)

  • Heap Fetches: 0
5. 1.433 1.433 ↑ 2.4 5,236 1

Index Only Scan using perimeter_reservation_agreement_parking_be_pkey on perimeter_reservation_agreement_parking prap_1 (cost=0.29..376.67 rows=12,559 width=8) (actual time=0.015..1.433 rows=5,236 loops=1)

  • Heap Fetches: 799
6. 4.137 4.137 ↑ 3.5 22,316 1

Index Only Scan using perimeter_reservation_agreement_parking_de_pkey on perimeter_reservation_agreement_parking prap_2 (cost=0.29..2,555.83 rows=78,733 width=8) (actual time=0.011..4.137 rows=22,316 loops=1)

  • Heap Fetches: 713
7. 27.843 27.843 ↑ 3.9 97,982 1

Index Only Scan using perimeter_reservation_agreement_parking_fr_pkey on perimeter_reservation_agreement_parking prap_3 (cost=0.42..14,440.20 rows=379,653 width=8) (actual time=0.010..27.843 rows=97,982 loops=1)

  • Heap Fetches: 22850
8. 0.009 0.009 ↑ 1.0 24 1

Index Only Scan using perimeter_reservation_agreement_parking_lu_pkey on perimeter_reservation_agreement_parking prap_4 (cost=0.14..8.50 rows=24 width=8) (actual time=0.005..0.009 rows=24 loops=1)

  • Heap Fetches: 0
9. 1.473 1.473 ↑ 1.2 9,726 1

Index Only Scan using perimeter_reservation_agreement_parking_uk_pkey on perimeter_reservation_agreement_parking prap_5 (cost=0.29..333.59 rows=11,287 width=8) (actual time=0.008..1.473 rows=9,726 loops=1)

  • Heap Fetches: 0
10. 10.325 10.325 ↑ 2.2 61,358 1

Index Only Scan using perimeter_reservation_agreement_parking_it_pkey on perimeter_reservation_agreement_parking prap_6 (cost=0.29..3,644.52 rows=134,388 width=8) (actual time=0.008..10.325 rows=61,358 loops=1)

  • Heap Fetches: 469
11. 377.090 7,175.826 ↑ 29.4 2,138,101 1

Materialize (cost=14,320,440.99..14,635,069.49 rows=62,925,700 width=173) (actual time=5,888.830..7,175.826 rows=2,138,101 loops=1)

12. 6,421.579 6,798.736 ↑ 29.4 2,138,101 1

Sort (cost=14,320,440.99..14,477,755.24 rows=62,925,700 width=173) (actual time=5,888.827..6,798.736 rows=2,138,101 loops=1)

  • Sort Key: pra.id, p.id
  • Sort Method: external merge Disk: 204256kB
13. 255.362 377.157 ↑ 29.4 2,138,101 1

Nested Loop Left Join (cost=1,551.50..792,362.50 rows=62,925,700 width=173) (actual time=6.874..377.157 rows=2,138,101 loops=1)

14. 4.283 13.412 ↑ 27.8 9,853 1

Merge Left Join (cost=1,551.50..5,683.50 rows=273,590 width=169) (actual time=6.805..13.412 rows=9,853 loops=1)

  • Merge Cond: (p.id = rap.parking_id)
15. 0.986 2.969 ↑ 3.6 1,571 1

Sort (cost=754.60..768.68 rows=5,630 width=169) (actual time=2.529..2.969 rows=1,571 loops=1)

  • Sort Key: p.id
  • Sort Method: quicksort Memory: 293kB
16. 0.485 1.983 ↑ 3.6 1,571 1

Hash Join (cost=31.09..403.88 rows=5,630 width=169) (actual time=0.137..1.983 rows=1,571 loops=1)

  • Hash Cond: (p.geographical_site_id = gs.id)
17. 0.120 1.375 ↑ 1.0 1,678 1

Append (cost=0.00..171.77 rows=1,678 width=86) (actual time=0.004..1.375 rows=1,678 loops=1)

18. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on parking p (cost=0.00..0.00 rows=1 width=646) (actual time=0.000..0.000 rows=0 loops=1)

19. 0.087 0.087 ↑ 1.0 121 1

Seq Scan on parking p_1 (cost=0.00..11.21 rows=121 width=81) (actual time=0.004..0.087 rows=121 loops=1)

20. 0.377 0.377 ↑ 1.0 499 1

Seq Scan on parking p_2 (cost=0.00..48.99 rows=499 width=83) (actual time=0.004..0.377 rows=499 loops=1)

21. 0.572 0.572 ↓ 1.0 756 1

Seq Scan on parking p_3 (cost=0.00..73.55 rows=755 width=80) (actual time=0.005..0.572 rows=756 loops=1)

22. 0.009 0.009 ↑ 1.0 6 1

Seq Scan on parking p_4 (cost=0.00..1.06 rows=6 width=646) (actual time=0.004..0.009 rows=6 loops=1)

23. 0.137 0.137 ↑ 1.0 181 1

Seq Scan on parking p_5 (cost=0.00..26.81 rows=181 width=91) (actual time=0.003..0.137 rows=181 loops=1)

24. 0.073 0.073 ↑ 1.0 115 1

Seq Scan on parking p_6 (cost=0.00..10.15 rows=115 width=102) (actual time=0.004..0.073 rows=115 loops=1)

25. 0.057 0.123 ↑ 2.8 243 1

Hash (cost=22.70..22.70 rows=671 width=91) (actual time=0.123..0.123 rows=243 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
26. 0.015 0.066 ↑ 2.8 243 1

Append (cost=0.00..22.70 rows=671 width=91) (actual time=0.002..0.066 rows=243 loops=1)

27. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on geographical_site gs (cost=0.00..0.00 rows=1 width=122) (actual time=0.000..0.000 rows=0 loops=1)

28. 0.001 0.001 ↑ 1.0 6 1

Seq Scan on geographical_site gs_1 (cost=0.00..1.06 rows=6 width=122) (actual time=0.001..0.001 rows=6 loops=1)

29. 0.018 0.018 ↓ 1.0 82 1

Seq Scan on geographical_site gs_2 (cost=0.00..1.81 rows=81 width=16) (actual time=0.004..0.018 rows=82 loops=1)

30. 0.023 0.023 ↓ 1.0 127 1

Seq Scan on geographical_site gs_3 (cost=0.00..3.25 rows=125 width=23) (actual time=0.005..0.023 rows=127 loops=1)

31. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on geographical_site gs_4 (cost=0.00..14.30 rows=430 width=122) (actual time=0.000..0.000 rows=0 loops=1)

32. 0.003 0.003 ↑ 1.0 14 1

Seq Scan on geographical_site gs_5 (cost=0.00..1.14 rows=14 width=122) (actual time=0.002..0.003 rows=14 loops=1)

33. 0.006 0.006 ↑ 1.0 14 1

Seq Scan on geographical_site gs_6 (cost=0.00..1.14 rows=14 width=122) (actual time=0.002..0.006 rows=14 loops=1)

34. 4.076 6.160 ↓ 1.0 9,744 1

Sort (cost=796.90..821.20 rows=9,719 width=4) (actual time=4.268..6.160 rows=9,744 loops=1)

  • Sort Key: rap.parking_id
  • Sort Method: quicksort Memory: 841kB
35. 0.632 2.084 ↓ 1.0 9,744 1

Append (cost=0.00..153.18 rows=9,719 width=4) (actual time=0.011..2.084 rows=9,744 loops=1)

36. 0.001 0.001 ↓ 0.0 0 1

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

37. 0.088 0.088 ↓ 1.0 587 1

Seq Scan on reservation_agreement_parking rap_1 (cost=0.00..9.86 rows=586 width=4) (actual time=0.010..0.088 rows=587 loops=1)

38. 0.441 0.441 ↓ 1.0 2,992 1

Seq Scan on reservation_agreement_parking rap_2 (cost=0.00..46.73 rows=2,973 width=4) (actual time=0.005..0.441 rows=2,992 loops=1)

39. 0.460 0.460 ↓ 1.0 3,071 1

Seq Scan on reservation_agreement_parking rap_3 (cost=0.00..47.65 rows=3,065 width=4) (actual time=0.004..0.460 rows=3,071 loops=1)

40. 0.006 0.006 ↑ 1.0 18 1

Seq Scan on reservation_agreement_parking rap_4 (cost=0.00..1.18 rows=18 width=4) (actual time=0.003..0.006 rows=18 loops=1)

41. 0.173 0.173 ↑ 1.0 1,081 1

Seq Scan on reservation_agreement_parking rap_5 (cost=0.00..16.81 rows=1,081 width=4) (actual time=0.003..0.173 rows=1,081 loops=1)

42. 0.283 0.283 ↑ 1.0 1,995 1

Seq Scan on reservation_agreement_parking rap_6 (cost=0.00..30.95 rows=1,995 width=4) (actual time=0.004..0.283 rows=1,995 loops=1)

43. 108.140 108.383 ↑ 1.1 217 9,853

Materialize (cost=0.00..108.32 rows=230 width=4) (actual time=0.000..0.011 rows=217 loops=9,853)

44. 0.024 0.243 ↑ 1.1 217 1

Append (cost=0.00..107.17 rows=230 width=4) (actual time=0.064..0.243 rows=217 loops=1)

45. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on perimeter_reservation_agreement pra (cost=0.00..0.00 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (reservation_agreement_id = 378)
46. 0.000 0.012 ↓ 0.0 0 1

Bitmap Heap Scan on perimeter_reservation_agreement pra_1 (cost=4.16..8.98 rows=2 width=4) (actual time=0.012..0.012 rows=0 loops=1)

  • Recheck Cond: (reservation_agreement_id = 378)
47. 0.012 0.012 ↓ 0.0 0 1

Bitmap Index Scan on be_perimeter_reservation_agreement_ra_id_perimeter_id_idx (cost=0.00..4.16 rows=2 width=0) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = 378)
48. 0.006 0.006 ↓ 0.0 0 1

Index Scan using de_perimeter_reservation_agreement_ra_id_perimeter_id_idx on perimeter_reservation_agreement pra_2 (cost=0.27..8.29 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = 378)
49. 0.104 0.138 ↑ 1.0 217 1

Bitmap Heap Scan on perimeter_reservation_agreement pra_3 (cost=9.99..69.76 rows=221 width=4) (actual time=0.042..0.138 rows=217 loops=1)

  • Recheck Cond: (reservation_agreement_id = 378)
  • Heap Blocks: exact=31
50. 0.034 0.034 ↑ 1.0 217 1

Bitmap Index Scan on fr_perimeter_reservation_agreement_ra_id_perimeter_id_idx (cost=0.00..9.94 rows=221 width=0) (actual time=0.034..0.034 rows=217 loops=1)

  • Index Cond: (reservation_agreement_id = 378)
51. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on perimeter_reservation_agreement pra_4 (cost=0.00..1.05 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (reservation_agreement_id = 378)
  • Rows Removed by Filter: 4
52. 0.049 0.049 ↓ 0.0 0 1

Seq Scan on perimeter_reservation_agreement pra_5 (cost=0.00..8.47 rows=2 width=4) (actual time=0.049..0.049 rows=0 loops=1)

  • Filter: (reservation_agreement_id = 378)
  • Rows Removed by Filter: 278
53. 0.001 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on perimeter_reservation_agreement pra_6 (cost=4.29..10.62 rows=2 width=4) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: (reservation_agreement_id = 378)
54. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on it_perimeter_reservation_agreement_ra_id_perimeter_id_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (reservation_agreement_id = 378)
Planning time : 1.964 ms
Execution time : 8,618.657 ms