explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7qXY

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

Hash Left Join (cost=3,850.55..3,857.13 rows=5 width=1,146) (actual time=347.171..349.100 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.002..0.002 rows=1 loops=1)

4.          

CTE asset_details

5. 0.027 0.635 ↓ 23.0 92 1

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

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

Initplan (for Sort)

7. 0.006 0.006 ↑ 1.0 1 1

CTE Scan on params (cost=0.00..0.02 rows=1 width=4) (actual time=0.006..0.006 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.065 0.601 ↓ 23.0 92 1

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

10. 0.100 0.260 ↓ 23.0 92 1

Hash Left Join (cost=4.57..20.99 rows=4 width=12) (actual time=0.093..0.260 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.123 0.123 ↓ 4.6 92 1

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
13. 0.024 0.024 ↑ 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.024 rows=82 loops=1)

14. 0.276 0.276 ↓ 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.003..0.003 rows=0 loops=92)

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

CTE asset

16. 0.018 2.783 ↓ 23.0 92 1

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

17. 0.065 2.765 ↓ 23.0 92 1

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

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

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

19. 0.043 2.380 ↓ 23.0 92 1

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

20. 0.027 2.337 ↓ 23.0 92 1

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

21. 0.065 2.218 ↓ 23.0 92 1

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

22. 0.063 1.877 ↓ 23.0 92 1

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

23. 0.084 1.446 ↓ 23.0 92 1

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

24. 0.209 0.994 ↓ 23.0 92 1

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

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

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

26. 0.015 0.674 ↓ 23.0 92 1

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

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

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

28. 0.368 0.368 ↑ 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.004..0.004 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.276 0.276 ↑ 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.003..0.003 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.632 11.327 ↓ 358.0 358 1

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

36.          

Initplan (for Nested Loop Left Join)

37. 0.001 0.001 ↑ 1.0 1 1

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

38. 0.178 8.262 ↓ 358.0 358 1

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

39. 0.364 7.368 ↓ 358.0 358 1

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

40. 0.261 7.004 ↓ 358.0 358 1

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

41. 0.489 6.385 ↓ 358.0 358 1

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

42. 0.505 5.180 ↓ 358.0 358 1

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

43. 0.325 3.601 ↓ 358.0 358 1

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

44. 0.322 1.486 ↓ 358.0 358 1

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

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

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

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

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

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

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

48. 1.790 1.790 ↑ 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.005..0.005 rows=1 loops=358)

  • Index Cond: (establishment_id = portfolio_implantation.establishment_id)
49. 1.074 1.074 ↑ 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.003..0.003 rows=1 loops=358)

  • Index Cond: (COALESCE(gen_establishment_search.address_id, portfolio_implantation.main_address_id) = id)
  • Filter: (deleted_at IS NULL)
50. 0.716 0.716 ↑ 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.002..0.002 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.432 1.432 ↑ 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.004..0.004 rows=1 loops=358)

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

CTE list_lots

56. 1.377 198.495 ↓ 434.0 434 1

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

57. 0.218 0.218 ↓ 358.0 358 1

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

58. 57.638 196.900 ↑ 1.0 1 358

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

  • Hash Cond: (lot.portfolio_implantation_id = portfolio_implantation_1.id)
59. 137.472 137.472 ↓ 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.384 rows=2,572 loops=358)

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

Hash (cost=8.29..8.29 rows=1 width=8) (actual time=0.005..0.005 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.131 202.263 ↓ 358.0 358 1

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

  • Group Key: portfolio_implantation_2.id
64. 0.283 201.132 ↓ 434.0 434 1

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

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

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

66. 198.934 198.934 ↓ 434.0 434 1

CTE Scan on list_lots (cost=0.00..0.02 rows=1 width=40) (actual time=0.237..198.934 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.341 1.149 ↓ 4.3 431 1

HashAggregate (cost=13.66..14.66 rows=100 width=20) (actual time=1.079..1.149 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.136 0.808 ↓ 8.6 862 1

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

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

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

72. 0.044 0.044 ↓ 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.044 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.170 ↓ 248.0 248 1

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

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

Seq Scan on ref_property_nature_i18n (cost=0.00..10.00 rows=1 width=4) (actual time=0.023..0.143 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. 8.358 219.315 ↓ 358.0 358 1

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

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

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

81. 210.862 210.862 ↓ 358.0 358 358

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

82.          

CTE implantation_grouped_by_nature

83. 0.294 14.169 ↓ 6.0 133 1

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

  • Group Key: implantation_2.portfolio_asset_id, lot_1.ref_property_nature_ids
84. 0.189 13.875 ↓ 4.3 431 1

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

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

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

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

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

87. 0.234 13.104 ↓ 431.0 431 1

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

  • Hash Cond: (lot_1.portfolio_implantation_id = implantation_2.id)
88. 0.491 0.491 ↓ 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.020..0.491 rows=2,572 loops=1)

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

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

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

CTE Scan on implantation implantation_2 (cost=0.00..0.02 rows=1 width=8) (actual time=0.180..12.258 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.072 ↓ 1.0 124 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
93. 0.051 0.051 ↓ 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.015..0.051 rows=124 loops=1)

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

CTE natures

95. 0.008 15.117 ↓ 10.1 91 1

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

96. 0.517 14.787 ↓ 17.5 35 1

GroupAggregate (cost=0.93..2.00 rows=2 width=68) (actual time=14.306..14.787 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.032 14.270 ↓ 6.0 133 1

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

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

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

99. 0.302 0.322 ↓ 8.0 56 1

HashAggregate (cost=0.77..1.12 rows=7 width=68) (actual time=0.297..0.322 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.020 0.020 ↓ 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.020 rows=133 loops=1)

101.          

CTE data_by_natures_id

102. 0.244 55.991 ↓ 1.3 133 1

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

  • Group Key: asset_2.id, implantation_lot_properties_unnest.ref_property_nature_id
103. 0.283 55.747 ↓ 4.3 431 1

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

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

Nested Loop Left Join (cost=0.84..859.67 rows=100 width=36) (actual time=16.696..55.464 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. 6.843 29.834 ↓ 4.3 431 1

Nested Loop Left Join (cost=0.84..857.41 rows=100 width=36) (actual time=16.656..29.834 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.144 2.303 ↓ 4.3 431 1

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

107. 0.320 0.435 ↓ 4.3 431 1

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

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

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

109. 0.011 0.033 ↓ 23.0 92 1

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

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

CTE Scan on asset asset_2 (cost=0.00..0.08 rows=4 width=8) (actual time=0.003..0.022 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.176 20.688 ↓ 248.0 248 431

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

113. 4.402 16.512 ↓ 248.0 248 1

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

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

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

115. 0.041 0.041 ↓ 358.0 358 1

CTE Scan on data_implantations (cost=0.00..0.02 rows=1 width=12) (actual time=0.000..0.041 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)