explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S6Zo

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

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

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

CTE params

3. 0.003 0.003 ↑ 1.0 1 1

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

4.          

CTE asset_details

5. 0.055 1.310 ↓ 23.0 92 1

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

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

Initplan (for Sort)

7. 0.008 0.008 ↑ 1.0 1 1

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

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

10. 0.128 0.387 ↓ 23.0 92 1

Hash Left Join (cost=4.57..20.99 rows=4 width=12) (actual time=0.126..0.387 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.210 0.210 ↓ 4.6 92 1

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

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

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

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

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

14. 0.828 0.828 ↓ 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.009..0.009 rows=0 loops=92)

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

CTE asset

16. 0.028 5.746 ↓ 23.0 92 1

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

17. 0.088 5.718 ↓ 23.0 92 1

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

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

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

19. 0.063 5.023 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.98..104.71 rows=4 width=328) (actual time=1.548..5.023 rows=92 loops=1)

20. 0.096 4.960 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.83..104.08 rows=4 width=326) (actual time=1.541..4.960 rows=92 loops=1)

21. 0.122 4.772 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.69..103.42 rows=4 width=318) (actual time=1.525..4.772 rows=92 loops=1)

22. 0.088 3.914 ↓ 23.0 92 1

Nested Loop Left Join (cost=1.25..85.56 rows=4 width=179) (actual time=1.486..3.914 rows=92 loops=1)

23. 0.111 2.814 ↓ 23.0 92 1

Nested Loop Left Join (cost=0.69..51.24 rows=4 width=159) (actual time=1.437..2.814 rows=92 loops=1)

24. 0.090 1.599 ↓ 23.0 92 1

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

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

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

26. 0.027 1.358 ↓ 23.0 92 1

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

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

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

28. 1.104 1.104 ↑ 1.0 1 92

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

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

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

  • Index Cond: (asset_details.main_address_id = id)
30. 0.736 0.736 ↑ 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.008..0.008 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.460 0.460 ↑ 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.005..0.005 rows=1 loops=92)

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

CTE implantation

35. 2.217 18.957 ↓ 358.0 358 1

Nested Loop Left Join (cost=2.45..121.40 rows=1 width=944) (actual time=0.284..18.957 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.338 14.949 ↓ 358.0 358 1

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

39. 0.512 13.895 ↓ 358.0 358 1

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

40. 0.492 13.383 ↓ 358.0 358 1

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

41. 0.312 12.533 ↓ 358.0 358 1

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

42. 0.592 10.789 ↓ 358.0 358 1

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

43. 0.583 8.049 ↓ 358.0 358 1

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

44. 0.368 2.096 ↓ 358.0 358 1

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

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

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

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

Hash (cost=0.08..0.08 rows=4 width=4) (actual time=0.027..0.027 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.001..0.012 rows=92 loops=1)

48. 5.370 5.370 ↑ 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.015..0.015 rows=1 loops=358)

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

  • Index Cond: (COALESCE(gen_establishment_search.address_id, portfolio_implantation.main_address_id) = id)
  • Filter: (deleted_at IS NULL)
50. 1.432 1.432 ↑ 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.004..0.004 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.344 201.333 ↓ 434.0 434 1

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

57. 0.225 0.225 ↓ 358.0 358 1

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

58. 60.860 199.764 ↑ 1.0 1 358

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

  • Hash Cond: (lot.portfolio_implantation_id = portfolio_implantation_1.id)
59. 137.114 137.114 ↓ 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.383 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.099 205.257 ↓ 358.0 358 1

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

  • Group Key: portfolio_implantation_2.id
64. 0.391 204.158 ↓ 434.0 434 1

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

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

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

66. 201.847 201.847 ↓ 434.0 434 1

CTE Scan on list_lots (cost=0.00..0.02 rows=1 width=40) (actual time=0.291..201.847 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.371 1.216 ↓ 4.3 431 1

HashAggregate (cost=13.66..14.66 rows=100 width=20) (actual time=1.135..1.216 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.140 0.845 ↓ 8.6 862 1

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

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

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

72. 0.045 0.045 ↓ 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.045 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.038 0.199 ↓ 248.0 248 1

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

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

Seq Scan on ref_property_nature_i18n (cost=0.00..10.00 rows=1 width=4) (actual time=0.028..0.161 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.178 222.358 ↓ 358.0 358 1

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

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

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

81. 214.084 214.084 ↓ 358.0 358 358

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

82.          

CTE implantation_grouped_by_nature

83. 0.306 22.307 ↓ 6.0 133 1

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

  • Group Key: implantation_2.portfolio_asset_id, lot_1.ref_property_nature_ids
84. 0.268 22.001 ↓ 4.3 431 1

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

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

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

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

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

87. 0.349 21.103 ↓ 431.0 431 1

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

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

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

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

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

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

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

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

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

CTE natures

95. 0.007 23.380 ↓ 10.1 91 1

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

96. 0.590 23.009 ↓ 17.5 35 1

GroupAggregate (cost=0.93..2.00 rows=2 width=68) (actual time=22.542..23.009 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.042 22.419 ↓ 6.0 133 1

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

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

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

99. 0.342 0.364 ↓ 8.0 56 1

HashAggregate (cost=0.77..1.12 rows=7 width=68) (actual time=0.335..0.364 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.022 0.022 ↓ 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.022 rows=133 loops=1)

101.          

CTE data_by_natures_id

102. 0.261 58.030 ↓ 1.3 133 1

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

  • Group Key: asset_2.id, implantation_lot_properties_unnest.ref_property_nature_id
103. 0.340 57.769 ↓ 4.3 431 1

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

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

Nested Loop Left Join (cost=0.84..859.67 rows=100 width=36) (actual time=17.332..57.429 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.907 31.573 ↓ 4.3 431 1

Nested Loop Left Join (cost=0.84..857.41 rows=100 width=36) (actual time=17.288..31.573 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.543 3.116 ↓ 4.3 431 1

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

107. 0.288 0.418 ↓ 4.3 431 1

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

  • Hash Cond: (implantation_lot_properties_unnest.portfolio_asset_id = asset_2.id)
108. 0.093 0.093 ↓ 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.093 rows=431 loops=1)

109. 0.016 0.037 ↓ 23.0 92 1

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

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

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

111. 2.155 2.155 ↑ 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.005..0.005 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.475 21.550 ↓ 248.0 248 431

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

113. 4.493 17.075 ↓ 248.0 248 1

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

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

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

115. 0.052 0.052 ↓ 358.0 358 1

CTE Scan on data_implantations (cost=0.00..0.02 rows=1 width=12) (actual time=0.001..0.052 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.590 11.590 ↓ 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.038 rows=283 loops=305)