explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l7Sb

Settings
# exclusive inclusive rows x rows loops node
1. 384.466 384.466 ↓ 18.4 92 1

Hash Left Join (cost=3,850.55..3,857.13 rows=5 width=1,146) (actual time=382.359..384.466 rows=92 loops=1)

  • Hash Cond: (asset.id = stats_by_asset.portfolio_asset_id)
2.          

CTE params

3. 0.002 0.002 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=36) (actual time=0.001..0.002 rows=1 loops=1)

4.          

CTE asset_details

5. 0.029 0.659 ↓ 23.0 92 1

Sort (cost=54.88..54.89 rows=4 width=16) (actual time=0.653..0.659 rows=92 loops=1)

  • Sort Key: portfolio_asset_1.main_address_id
  • Sort Method: quicksort Memory: 29kB
6.          

Initplan (for Sort)

7. 0.005 0.005 ↑ 1.0 1 1

CTE Scan on params (cost=0.00..0.02 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

8. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on params params_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

9. 0.001 0.624 ↓ 23.0 92 1

Nested Loop Left Join (cost=5.00..54.80 rows=4 width=16) (actual time=0.109..0.624 rows=92 loops=1)

10. 0.095 0.255 ↓ 23.0 92 1

Hash Left Join (cost=4.57..20.99 rows=4 width=12) (actual time=0.084..0.255 rows=92 loops=1)

  • Hash Cond: (portfolio_asset_1.company_branch_id = company_branch_1.id)
  • Filter: ((company_branch_1.deleted_at IS NULL) AND ((portfolio_asset_1.company_branch_id IS NULL) OR (ARRAY[company_branch_1.user_community_id] && $2)))
11. 0.122 0.122 ↓ 4.6 92 1

Seq Scan on portfolio_asset portfolio_asset_1 (cost=0.00..16.38 rows=20 width=16) (actual time=0.027..0.122 rows=92 loops=1)

  • Filter: ((deleted_at IS NULL) AND (user_company_id = $1))
  • Rows Removed by Filter: 168
12. 0.013 0.038 ↑ 1.4 82 1

Hash (cost=3.14..3.14 rows=114 width=16) (actual time=0.037..0.038 rows=82 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
13. 0.025 0.025 ↑ 1.4 82 1

Seq Scan on company_branch company_branch_1 (cost=0.00..3.14 rows=114 width=16) (actual time=0.010..0.025 rows=82 loops=1)

14. 0.368 0.368 ↓ 0.0 0 92

Index Scan using gen_match_cap_address_pkey on gen_match_cap_address (cost=0.43..8.45 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=92)

  • Index Cond: (address_id = portfolio_asset_1.main_address_id)
15.          

CTE asset

16. 0.017 2.899 ↓ 23.0 92 1

Unique (cost=122.10..122.12 rows=4 width=592) (actual time=2.878..2.899 rows=92 loops=1)

17. 0.065 2.882 ↓ 23.0 92 1

Sort (cost=122.10..122.11 rows=4 width=592) (actual time=2.877..2.882 rows=92 loops=1)

  • Sort Key: portfolio_asset_2.id
  • Sort Method: quicksort Memory: 37kB
18. 0.197 2.817 ↓ 23.0 92 1

Nested Loop Left Join (cost=2.27..122.06 rows=4 width=592) (actual time=0.843..2.817 rows=92 loops=1)

19. 0.053 2.436 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.98..104.71 rows=4 width=332) (actual time=0.802..2.436 rows=92 loops=1)

20. 0.031 2.383 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.83..104.08 rows=4 width=330) (actual time=0.797..2.383 rows=92 loops=1)

21. 0.015 2.260 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.69..103.42 rows=4 width=322) (actual time=0.787..2.260 rows=92 loops=1)

22. 0.099 1.877 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.25..85.56 rows=4 width=183) (actual time=0.773..1.877 rows=92 loops=1)

23. 0.046 1.410 ↓ 23.0 92 1

Nested Loop Left Join (cost=0.69..51.24 rows=4 width=163) (actual time=0.755..1.410 rows=92 loops=1)

24. 0.068 0.904 ↓ 23.0 92 1

Hash Right Join (cost=0.13..16.88 rows=4 width=107) (actual time=0.733..0.904 rows=92 loops=1)

  • Hash Cond: (portfolio_asset_2.id = asset_details.id)
25. 0.125 0.125 ↑ 1.0 260 1

Seq Scan on portfolio_asset portfolio_asset_2 (cost=0.00..15.70 rows=270 width=99) (actual time=0.012..0.125 rows=260 loops=1)

26. 0.022 0.711 ↓ 23.0 92 1

Hash (cost=0.08..0.08 rows=4 width=12) (actual time=0.711..0.711 rows=92 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
27. 0.689 0.689 ↓ 23.0 92 1

CTE Scan on asset_details (cost=0.00..0.08 rows=4 width=12) (actual time=0.655..0.689 rows=92 loops=1)

28. 0.460 0.460 ↑ 1.0 1 92

Index Scan using gen_building_building_id on gen_building (cost=0.56..8.58 rows=1 width=60) (actual time=0.005..0.005 rows=1 loops=92)

  • Index Cond: (asset_details.building_id = building_id)
29. 0.368 0.368 ↑ 1.0 1 92

Index Scan using address_pkey on address (cost=0.56..8.58 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=92)

  • Index Cond: (asset_details.main_address_id = id)
30. 0.368 0.368 ↑ 1.0 1 92

Index Scan using address_street_pkey on address_street (cost=0.43..4.46 rows=1 width=147) (actual time=0.004..0.004 rows=1 loops=92)

  • Index Cond: (address.address_street_id = id)
31. 0.092 0.092 ↑ 1.0 1 92

Index Scan using ref_address_street_type_pkey on ref_address_street_type (cost=0.15..0.17 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=92)

  • Index Cond: (id = address_street.ref_address_street_type_id)
32. 0.000 0.000 ↓ 0.0 0 92

Index Scan using ref_address_cardinal_pkey on ref_address_cardinal (cost=0.14..0.16 rows=1 width=6) (actual time=0.000..0.000 rows=0 loops=92)

  • Index Cond: (id = address.ref_address_cardinal_id)
33. 0.184 0.184 ↑ 1.0 1 92

Index Scan using ref_postal_city_pkey on ref_postal_city (cost=0.29..4.29 rows=1 width=27) (actual time=0.002..0.002 rows=1 loops=92)

  • Index Cond: (address_street.ref_postal_city_id = id)
34.          

CTE implantation

35. 1.995 24.940 ↓ 358.0 358 1

Nested Loop Left Join (cost=2.45..121.40 rows=1 width=944) (actual time=0.222..24.940 rows=358 loops=1)

36.          

Initplan (for Nested Loop Left Join)

37. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on params params_2 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)

38. 0.458 21.153 ↓ 358.0 358 1

Nested Loop Left Join (cost=2.14..118.59 rows=1 width=1,061) (actual time=0.157..21.153 rows=358 loops=1)

39. 0.471 19.979 ↓ 358.0 358 1

Nested Loop Left Join (cost=1.85..116.06 rows=1 width=1,045) (actual time=0.147..19.979 rows=358 loops=1)

40. 0.479 19.508 ↓ 358.0 358 1

Nested Loop Left Join (cost=1.71..115.90 rows=1 width=1,043) (actual time=0.140..19.508 rows=358 loops=1)

41. 0.260 18.671 ↓ 358.0 358 1

Nested Loop Left Join (cost=1.56..115.73 rows=1 width=1,035) (actual time=0.130..18.671 rows=358 loops=1)

42. 0.568 6.955 ↓ 358.0 358 1

Nested Loop Left Join (cost=1.13..112.99 rows=1 width=896) (actual time=0.115..6.955 rows=358 loops=1)

43. 0.775 4.955 ↓ 358.0 358 1

Nested Loop Left Join (cost=0.56..104.41 rows=1 width=884) (actual time=0.094..4.955 rows=358 loops=1)

44. 0.429 2.032 ↓ 358.0 358 1

Hash Join (cost=0.13..95.95 rows=1 width=880) (actual time=0.073..2.032 rows=358 loops=1)

  • Hash Cond: (portfolio_implantation.portfolio_asset_id = asset_1.id)
45. 1.575 1.575 ↓ 6.2 359 1

Seq Scan on portfolio_implantation (cost=0.00..95.59 rows=58 width=880) (actual time=0.032..1.575 rows=359 loops=1)

  • Filter: ((deleted_at IS NULL) AND (user_company_id = $12))
  • Rows Removed by Filter: 1611
46. 0.013 0.028 ↓ 23.0 92 1

Hash (cost=0.08..0.08 rows=4 width=4) (actual time=0.027..0.028 rows=92 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
47. 0.015 0.015 ↓ 23.0 92 1

CTE Scan on asset asset_1 (cost=0.00..0.08 rows=4 width=4) (actual time=0.001..0.015 rows=92 loops=1)

48. 2.148 2.148 ↑ 1.0 1 358

Index Scan using gen_establishment_search_establishment_id on gen_establishment_search (cost=0.43..8.45 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=358)

  • Index Cond: (establishment_id = portfolio_implantation.establishment_id)
49. 1.432 1.432 ↑ 1.0 1 358

Index Scan using address_pkey on address address_1 (cost=0.56..8.58 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=358)

  • Index Cond: (COALESCE(gen_establishment_search.address_id, portfolio_implantation.main_address_id) = id)
  • Filter: (deleted_at IS NULL)
50. 11.456 11.456 ↑ 1.0 1 358

Index Scan using address_street_pkey on address_street address_street_1 (cost=0.43..2.75 rows=1 width=147) (actual time=0.032..0.032 rows=1 loops=358)

  • Index Cond: (address_1.address_street_id = id)
  • Filter: (deleted_at IS NULL)
51. 0.358 0.358 ↑ 1.0 1 358

Index Scan using ref_address_street_type_pkey on ref_address_street_type ref_address_street_type_1 (cost=0.15..0.17 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=358)

  • Index Cond: (id = address_street_1.ref_address_street_type_id)
52. 0.000 0.000 ↓ 0.0 0 358

Index Scan using ref_address_cardinal_pkey on ref_address_cardinal ref_address_cardinal_1 (cost=0.14..0.16 rows=1 width=6) (actual time=0.000..0.000 rows=0 loops=358)

  • Index Cond: (id = address_1.ref_address_cardinal_id)
53. 0.716 0.716 ↑ 1.0 1 358

Index Scan using ref_postal_city_pkey on ref_postal_city ref_postal_city_1 (cost=0.29..2.53 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=358)

  • Index Cond: (address_street_1.ref_postal_city_id = id)
54. 1.790 1.790 ↑ 1.0 1 358

Index Scan using ref_postal_code_pkey on ref_postal_code (cost=0.29..2.52 rows=1 width=10) (actual time=0.005..0.005 rows=1 loops=358)

  • Index Cond: (ref_postal_city_1.ref_postal_code_id = id)
55.          

CTE list_lots

56. 1.441 206.099 ↓ 434.0 434 1

Nested Loop Left Join (cost=8.31..77.32 rows=1 width=41) (actual time=0.290..206.099 rows=434 loops=1)

57. 0.240 0.240 ↓ 358.0 358 1

CTE Scan on implantation (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.240 rows=358 loops=1)

58. 60.144 204.418 ↑ 1.0 1 358

Hash Right Join (cost=8.31..77.29 rows=1 width=40) (actual time=0.318..0.571 rows=1 loops=358)

  • Hash Cond: (lot.portfolio_implantation_id = portfolio_implantation_1.id)
59. 142.126 142.126 ↓ 1.0 2,572 358

Seq Scan on portfolio_implantation_lot lot (cost=0.00..62.22 rows=2,571 width=36) (actual time=0.002..0.397 rows=2,572 loops=358)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 53
60. 0.716 2.148 ↑ 1.0 1 358

Hash (cost=8.29..8.29 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=358)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
61. 1.432 1.432 ↑ 1.0 1 358

Index Scan using portfolio_implantation_pkey on portfolio_implantation portfolio_implantation_1 (cost=0.28..8.29 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=358)

  • Index Cond: (id = implantation.id)
  • Filter: (deleted_at IS NULL)
62.          

CTE grouped_lots

63. 1.246 210.239 ↓ 358.0 358 1

GroupAggregate (cost=8.33..8.64 rows=1 width=33) (actual time=208.991..210.239 rows=358 loops=1)

  • Group Key: portfolio_implantation_2.id
64. 0.344 208.993 ↓ 434.0 434 1

Sort (cost=8.33..8.34 rows=1 width=45) (actual time=208.948..208.993 rows=434 loops=1)

  • Sort Key: portfolio_implantation_2.id
  • Sort Method: quicksort Memory: 58kB
65. 0.778 208.649 ↓ 434.0 434 1

Nested Loop Left Join (cost=0.28..8.32 rows=1 width=45) (actual time=0.311..208.649 rows=434 loops=1)

66. 206.569 206.569 ↓ 434.0 434 1

CTE Scan on list_lots (cost=0.00..0.02 rows=1 width=40) (actual time=0.292..206.569 rows=434 loops=1)

67. 1.302 1.302 ↑ 1.0 1 434

Index Scan using portfolio_implantation_pkey on portfolio_implantation portfolio_implantation_2 (cost=0.28..8.29 rows=1 width=9) (actual time=0.003..0.003 rows=1 loops=434)

  • Index Cond: (id = list_lots.portfolio_implantation_id)
68.          

CTE implantation_lot_properties_unnest

69. 0.346 1.220 ↓ 4.3 431 1

HashAggregate (cost=13.66..14.66 rows=100 width=20) (actual time=1.150..1.220 rows=431 loops=1)

  • Group Key: list_lots_1.portfolio_asset_id, list_lots_1.portfolio_implantation_id, list_lots_1.portfolio_implantation_lot_id, ref_property_nature_id.ref_property_nature_id
70. 0.162 0.874 ↓ 8.6 862 1

Hash Left Join (cost=10.01..12.41 rows=100 width=20) (actual time=0.234..0.874 rows=862 loops=1)

  • Hash Cond: (ref_property_nature_id.ref_property_nature_id = ref_property_nature_i18n.id)
71. 0.046 0.534 ↓ 4.3 431 1

Nested Loop (cost=0.00..2.02 rows=100 width=20) (actual time=0.025..0.534 rows=431 loops=1)

72. 0.054 0.054 ↓ 434.0 434 1

CTE Scan on list_lots list_lots_1 (cost=0.00..0.02 rows=1 width=48) (actual time=0.001..0.054 rows=434 loops=1)

73. 0.434 0.434 ↑ 100.0 1 434

Function Scan on unnest ref_property_nature_id (cost=0.00..1.00 rows=100 width=4) (actual time=0.001..0.001 rows=1 loops=434)

74. 0.027 0.178 ↓ 248.0 248 1

Hash (cost=10.00..10.00 rows=1 width=4) (actual time=0.178..0.178 rows=248 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
75. 0.151 0.151 ↓ 248.0 248 1

Seq Scan on ref_property_nature_i18n (cost=0.00..10.00 rows=1 width=4) (actual time=0.030..0.151 rows=248 loops=1)

  • Filter: ((culture)::text = ((SubPlan 10))::text)
76.          

SubPlan (for Seq Scan)

77. 0.000 0.000 ↑ 1.0 1 248

CTE Scan on params params_3 (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=248)

78.          

CTE data_implantations

79. 9.119 229.051 ↓ 358.0 358 1

Nested Loop Left Join (cost=0.00..0.06 rows=1 width=44) (actual time=209.431..229.051 rows=358 loops=1)

  • Join Filter: (grouped_lots.id = implantation_1.id)
  • Rows Removed by Join Filter: 127806
80. 0.120 0.120 ↓ 358.0 358 1

CTE Scan on implantation implantation_1 (cost=0.00..0.02 rows=1 width=13) (actual time=0.001..0.120 rows=358 loops=1)

81. 219.812 219.812 ↓ 358.0 358 358

CTE Scan on grouped_lots (cost=0.00..0.02 rows=1 width=20) (actual time=0.584..0.614 rows=358 loops=358)

82.          

CTE implantation_grouped_by_nature

83. 0.636 38.022 ↓ 6.0 133 1

GroupAggregate (cost=84.11..87.05 rows=22 width=72) (actual time=37.426..38.022 rows=133 loops=1)

  • Group Key: implantation_2.portfolio_asset_id, lot_1.ref_property_nature_ids
84. 0.269 37.386 ↓ 4.3 431 1

Sort (cost=84.11..84.36 rows=100 width=53) (actual time=37.357..37.386 rows=431 loops=1)

  • Sort Key: implantation_2.portfolio_asset_id, lot_1.ref_property_nature_ids
  • Sort Method: quicksort Memory: 64kB
85. 0.183 37.117 ↓ 4.3 431 1

Hash Left Join (cost=6.65..80.79 rows=100 width=53) (actual time=35.322..37.117 rows=431 loops=1)

  • Hash Cond: (ref_property_nature_id_1.ref_property_nature_id = ref_property_nature_i18n_1.id)
86. 0.111 36.856 ↓ 4.3 431 1

Nested Loop (cost=0.04..73.91 rows=100 width=36) (actual time=35.155..36.856 rows=431 loops=1)

87. 0.468 36.314 ↓ 431.0 431 1

Hash Join (cost=0.03..71.90 rows=1 width=32) (actual time=35.133..36.314 rows=431 loops=1)

  • Hash Cond: (lot_1.portfolio_implantation_id = implantation_2.id)
88. 0.763 0.763 ↓ 1.0 2,572 1

Seq Scan on portfolio_implantation_lot lot_1 (cost=0.00..62.22 rows=2,571 width=32) (actual time=0.025..0.763 rows=2,572 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 53
89. 0.163 35.083 ↓ 358.0 358 1

Hash (cost=0.02..0.02 rows=1 width=8) (actual time=35.083..35.083 rows=358 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
90. 34.920 34.920 ↓ 358.0 358 1

CTE Scan on implantation implantation_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.228..34.920 rows=358 loops=1)

91. 0.431 0.431 ↑ 100.0 1 431

Function Scan on unnest ref_property_nature_id_1 (cost=0.00..1.00 rows=100 width=4) (actual time=0.001..0.001 rows=1 loops=431)

92. 0.021 0.078 ↓ 1.0 124 1

Hash (cost=5.08..5.08 rows=123 width=21) (actual time=0.078..0.078 rows=124 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
93. 0.057 0.057 ↓ 1.0 124 1

Seq Scan on ref_property_nature_i18n ref_property_nature_i18n_1 (cost=0.00..5.08 rows=123 width=21) (actual time=0.021..0.057 rows=124 loops=1)

  • Filter: ((culture)::text = 'fr_FR'::text)
  • Rows Removed by Filter: 124
94.          

CTE natures

95. 0.009 39.187 ↓ 10.1 91 1

Append (cost=0.93..3.26 rows=9 width=68) (actual time=38.167..39.187 rows=91 loops=1)

96. 0.602 38.721 ↓ 17.5 35 1

GroupAggregate (cost=0.93..2.00 rows=2 width=68) (actual time=38.166..38.721 rows=35 loops=1)

  • Group Key: implantation_grouped_by_nature.portfolio_asset_id
  • Filter: ((count(DISTINCT CASE WHEN (implantation_grouped_by_nature.ref_property_nature_id <> ALL ('{96,97,6}'::integer[])) THEN implantation_grouped_by_nature.ref_property_nature_id ELSE NULL::integer END) >= 1) AND (count(DISTINCT implantation_grouped_by_nature.ref_property_nature_id) > 1))
  • Rows Removed by Filter: 56
97. 0.033 38.119 ↓ 6.0 133 1

Sort (cost=0.93..0.99 rows=22 width=48) (actual time=38.111..38.119 rows=133 loops=1)

  • Sort Key: implantation_grouped_by_nature.portfolio_asset_id
  • Sort Method: quicksort Memory: 35kB
98. 38.086 38.086 ↓ 6.0 133 1

CTE Scan on implantation_grouped_by_nature (cost=0.00..0.44 rows=22 width=48) (actual time=37.429..38.086 rows=133 loops=1)

99. 0.432 0.457 ↓ 8.0 56 1

HashAggregate (cost=0.77..1.12 rows=7 width=68) (actual time=0.412..0.457 rows=56 loops=1)

  • Group Key: implantation_grouped_by_nature_1.portfolio_asset_id
  • Filter: (count(implantation_grouped_by_nature_1.ref_property_nature_id) < 2)
  • Rows Removed by Filter: 35
100. 0.025 0.025 ↓ 6.0 133 1

CTE Scan on implantation_grouped_by_nature implantation_grouped_by_nature_1 (cost=0.00..0.44 rows=22 width=48) (actual time=0.001..0.025 rows=133 loops=1)

101.          

CTE data_by_natures_id

102. 0.257 56.653 ↓ 1.3 133 1

GroupAggregate (cost=863.00..867.75 rows=100 width=32) (actual time=56.393..56.653 rows=133 loops=1)

  • Group Key: asset_2.id, implantation_lot_properties_unnest.ref_property_nature_id
103. 0.265 56.396 ↓ 4.3 431 1

Sort (cost=863.00..863.25 rows=100 width=36) (actual time=56.364..56.396 rows=431 loops=1)

  • Sort Key: asset_2.id, implantation_lot_properties_unnest.ref_property_nature_id
  • Sort Method: quicksort Memory: 55kB
104. 25.710 56.131 ↓ 4.3 431 1

Nested Loop Left Join (cost=0.84..859.67 rows=100 width=36) (actual time=16.943..56.131 rows=431 loops=1)

  • Join Filter: (list_lots_2.portfolio_implantation_lot_id = implantation_lot_properties_unnest.portfolio_implantation_lot_id)
  • Rows Removed by Join Filter: 186623
105. 7.086 30.421 ↓ 4.3 431 1

Nested Loop Left Join (cost=0.84..857.41 rows=100 width=36) (actual time=16.899..30.421 rows=431 loops=1)

  • Join Filter: (portfolio_implantation_3.id = implantation_lot_properties_unnest.portfolio_implantation_id)
  • Rows Removed by Join Filter: 106640
106. 0.111 2.216 ↓ 4.3 431 1

Nested Loop Left Join (cost=0.56..847.55 rows=100 width=24) (actual time=0.082..2.216 rows=431 loops=1)

107. 0.252 0.381 ↓ 4.3 431 1

Hash Left Join (cost=0.13..2.54 rows=100 width=20) (actual time=0.052..0.381 rows=431 loops=1)

  • Hash Cond: (implantation_lot_properties_unnest.portfolio_asset_id = asset_2.id)
108. 0.094 0.094 ↓ 4.3 431 1

CTE Scan on implantation_lot_properties_unnest (cost=0.00..2.00 rows=100 width=16) (actual time=0.001..0.094 rows=431 loops=1)

109. 0.012 0.035 ↓ 23.0 92 1

Hash (cost=0.08..0.08 rows=4 width=8) (actual time=0.035..0.035 rows=92 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
110. 0.023 0.023 ↓ 23.0 92 1

CTE Scan on asset asset_2 (cost=0.00..0.08 rows=4 width=8) (actual time=0.004..0.023 rows=92 loops=1)

111. 1.724 1.724 ↑ 1.0 1 431

Index Scan using building_nature_price_rent_pkey on building_nature_price_rent (cost=0.43..8.45 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=431)

  • Index Cond: ((asset_2.building_id = building_id) AND (ref_property_nature_id = implantation_lot_properties_unnest.ref_property_nature_id))
112. 4.382 21.119 ↓ 248.0 248 431

Materialize (cost=0.28..8.37 rows=1 width=20) (actual time=0.000..0.049 rows=248 loops=431)

113. 4.521 16.737 ↓ 248.0 248 1

Nested Loop (cost=0.28..8.37 rows=1 width=20) (actual time=0.037..16.737 rows=248 loops=1)

  • Join Filter: (portfolio_implantation_3.id = grouped_lots_1.id)
  • Rows Removed by Join Filter: 86067
114. 0.166 0.931 ↓ 305.0 305 1

Nested Loop (cost=0.28..8.32 rows=1 width=16) (actual time=0.019..0.931 rows=305 loops=1)

115. 0.049 0.049 ↓ 358.0 358 1

CTE Scan on data_implantations (cost=0.00..0.02 rows=1 width=12) (actual time=0.001..0.049 rows=358 loops=1)

116. 0.716 0.716 ↑ 1.0 1 358

Index Scan using portfolio_implantation_pkey on portfolio_implantation portfolio_implantation_3 (cost=0.28..8.29 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=358)

  • Index Cond: (id = data_implantations.id)
  • Filter: (NOT is_vacant)
  • Rows Removed by Filter: 0
117. 11.285 11.285 ↓ 283.0 283 305

CTE Scan on grouped_lots grouped_lots_1 (cost=0.00..0.02 rows=1 width=12) (actual time=0.000..0.037 rows=283 loops=305)