explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YsE

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=33,063.16..33,063.47 rows=1 width=1,764) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Result (cost=33,063.16..33,063.47 rows=1 width=1,764) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=33,063.16..33,063.17 rows=1 width=1,785) (actual rows= loops=)

  • Sort Key: m.date_start DESC
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,306.66..33,063.15 rows=1 width=1,785) (actual rows= loops=)

  • Join Filter: (chauffage.chauffage_energie_id = chauffage_energie.id)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,306.66..33,057.63 rows=1 width=2,553) (actual rows= loops=)

  • Join Filter: (cuisine.cuisine_type_id = cuisine_type.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,306.66..33,056.47 rows=1 width=2,037) (actual rows= loops=)

  • Join Filter: (ct.dossier_id = a.dossier_id)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,306.38..33,051.96 rows=5 width=2,053) (actual rows= loops=)

  • Join Filter: (ct.dossier_id = ct_2.dossier_id)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,306.37..33,029.45 rows=1 width=1,761) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,305.95..33,028.93 rows=1 width=1,765) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=19,305.66..33,028.57 rows=1 width=1,769) (actual rows= loops=)

  • Join Filter: (facture.dossier_id = a_1.dossier_id)
  • Filter: (((d.vente_etape_id >= 1300) AND (d.vente_etape_id < 100000)) OR ((d.vente_etape_id >= 100000) AND ((CURRENT_DATE - (facture.date_dernier_recu)::date) < 365)))
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=19,305.66..32,761.80 rows=1 width=1,773) (actual rows= loops=)

  • Join Filter: (d_1.id = a_1.dossier_id)
12. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.97..28,097.47 rows=1 width=1,741) (actual rows= loops=)

  • Join Filter: (proche_r.id = proche_d.region_id)
13. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.97..28,094.89 rows=1 width=1,739) (actual rows= loops=)

  • Join Filter: (proche_d.id = proche_c.departement_id)
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.97..28,043.64 rows=1 width=1,742) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.68..28,043.22 rows=1 width=1,706) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.39..28,042.78 rows=1 width=1,684) (actual rows= loops=)

  • Join Filter: (facture_1.dossier_id = d.id)
17. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.39..27,859.48 rows=1 width=1,684) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.10..27,857.31 rows=1 width=1,684) (actual rows= loops=)

  • Join Filter: (vt.id = m.vente_type_id)
19. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,659.10..27,856.08 rows=1 width=1,604) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,658.81..27,853.93 rows=1 width=1,577) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,658.52..27,847.73 rows=5 width=699) (actual rows= loops=)

  • Join Filter: (ct.dossier_id = ct_1.dossier_id)
22. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,658.52..27,825.23 rows=1 width=679) (actual rows= loops=)

  • Join Filter: (bien_sous_type.id = bien_1.bien_sous_type_id)
23. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,658.52..27,821.60 rows=1 width=663) (actual rows= loops=)

  • Join Filter: (bien_type.id = bien_1.bien_type_id)
24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,658.52..27,820.17 rows=1 width=147) (actual rows= loops=)

  • Join Filter: (bien_1.cuisine_id = cuisine.id)
25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,658.52..27,818.97 rows=1 width=146) (actual rows= loops=)

  • Join Filter: (d.vente_etape_id = vente_etape.id)
26. 0.000 0.000 ↓ 0.0

Hash Join (cost=14,658.52..27,817.54 rows=1 width=146) (actual rows= loops=)

  • Hash Cond: (bien_1.id = d.bien_id)
27. 0.000 0.000 ↓ 0.0

Hash Join (cost=13,499.28..26,391.88 rows=71,044 width=118) (actual rows= loops=)

  • Hash Cond: (bien_1.chauffage_id = chauffage.id)
28. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=12,544.15..25,250.24 rows=71,044 width=118) (actual rows= loops=)

  • Hash Cond: (ad.id = bien_1.adresse_id)
29. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,816.76..15,813.41 rows=228,457 width=61) (actual rows= loops=)

  • Hash Cond: (dept.region_id = reg.id)
30. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,814.17..15,113.37 rows=228,457 width=59) (actual rows= loops=)

  • Hash Cond: (rc.departement_id = dept.id)
31. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,762.92..14,437.00 rows=228,457 width=62) (actual rows= loops=)

  • Hash Cond: (rcp.commune_id = rc.id)
32. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,210.59..9,284.90 rows=228,457 width=58) (actual rows= loops=)

  • Hash Cond: (ad.commune_postale_id = rcp.id)
33. 0.000 0.000 ↓ 0.0

Seq Scan on adresse ad (cost=0.00..7,474.57 rows=228,457 width=44) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash (cost=720.26..720.26 rows=39,226 width=26) (actual rows= loops=)

  • -> Seq Scan on commune_postale rcp (cost=0.00..720.26 rows=39226 width=2…
35. 0.000 0.000 ↓ 0.0

Hash (cost=4,093.26..4,093.26 rows=36,726 width=12) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Seq Scan on commune rc (cost=0.00..4,093.26 rows=36,726 width=12) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash (cost=50.00..50.00 rows=100 width=9) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Seq Scan on departement dept (cost=0.00..50.00 rows=100 width=9) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Hash (cost=2.26..2.26 rows=26 width=4) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Seq Scan on region reg (cost=0.00..2.26 rows=26 width=4) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Hash (cost=5,839.34..5,839.34 rows=71,044 width=65) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=4,333.49..5,839.34 rows=71,044 width=65) (actual rows= loops=)

  • Hash Cond: (dossier.bien_id = bien_1.id)
43. 0.000 0.000 ↓ 0.0

Seq Scan on dossier (cost=0.00..1,319.37 rows=71,037 width=4) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Hash (cost=3,445.44..3,445.44 rows=71,044 width=69) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on bien bien_1 (cost=0.00..3,445.44 rows=71,044 width=69) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash (cost=525.06..525.06 rows=34,406 width=16) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on chauffage (cost=0.00..525.06 rows=34,406 width=16) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Hash (cost=1,159.23..1,159.23 rows=1 width=28) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..1,159.23 rows=1 width=28) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Function Scan on crosstab ct (cost=0.00..10.00 rows=1,000 width=12) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Index Scan using dossier_pkey on dossier d (cost=0.29..1.15 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = ct.dossier_id)
  • Filter: ((((vente_etape_id >= 1300) AND (vente_etape_id < 100000)) OR (vente_etape_id >= 100000)) …
52. 0.000 0.000 ↓ 0.0

Seq Scan on vente_etape (cost=0.00..1.19 rows=19 width=4) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Seq Scan on cuisine (cost=0.00..1.09 rows=9 width=9) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on bien_type (cost=0.00..1.19 rows=19 width=520) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Seq Scan on bien_sous_type (cost=0.00..2.17 rows=117 width=20) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Function Scan on crosstab ct_1 (cost=0.00..10.00 rows=1,000 width=20) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Index Scan using annonce_dossier_id_uniq on annonce a_1 (cost=0.29..1.24 rows=1 width=878) (actual rows= loops=)

  • Index Cond: (dossier_id = ct.dossier_id)
  • Filter: (on_csite_enabled AND allow_csite AND (delai_parution = 0))
58. 0.000 0.000 ↓ 0.0

Index Scan using mdt_id_uniq on mandat m (cost=0.29..2.16 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (d.mandat_id = id)
59. 0.000 0.000 ↓ 0.0

Seq Scan on vente_type vt (cost=0.00..1.10 rows=10 width=84) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Index Only Scan using estimation_dossier_id_idx on estimation e (cost=0.29..2.17 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (dossier_id = d.id)
61. 0.000 0.000 ↓ 0.0

Seq Scan on facture facture_1 (cost=0.00..123.67 rows=4,770 width=4) (actual rows= loops=)

  • Filter: (avoir_id IS NULL)
62. 0.000 0.000 ↓ 0.0

Index Scan using commune_postale_pkey on commune_postale proche_cp (cost=0.29..0.44 rows=1 width=26) (actual rows= loops=)

  • Index Cond: (id = a_1.commune_postale_id)
63. 0.000 0.000 ↓ 0.0

Index Scan using commune_pkey on commune proche_c (cost=0.29..0.41 rows=1 width=44) (actual rows= loops=)

  • Index Cond: (id = proche_cp.commune_id)
64. 0.000 0.000 ↓ 0.0

Seq Scan on departement proche_d (cost=0.00..50.00 rows=100 width=9) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Seq Scan on region proche_r (cost=0.00..2.26 rows=26 width=4) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4,645.69..4,656.34 rows=355 width=36) (actual rows= loops=)

  • Group Key: d_1.id
67. 0.000 0.000 ↓ 0.0

Sort (cost=4,645.69..4,646.58 rows=355 width=82) (actual rows= loops=)

  • Sort Key: d_1.id
68. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4,630.66 rows=355 width=82) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..4,512.62 rows=355 width=82) (actual rows= loops=)

  • Join Filter: (('{}'::integer[] || bi.id) <@ b.bien_info_ids)
70. 0.000 0.000 ↓ 0.0

Seq Scan on bien_info bi (cost=0.00..1.52 rows=1 width=82) (actual rows= loops=)

  • Filter: (bien_info_type_id = 1)
71. 0.000 0.000 ↓ 0.0

Seq Scan on bien b (cost=0.00..3,445.44 rows=71,044 width=35) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Index Scan using dossier_bien_id_idx on dossier d_1 (cost=0.29..0.32 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bien_id = b.id)
73. 0.000 0.000 ↓ 0.0

Seq Scan on facture (cost=0.00..123.67 rows=4,770 width=12) (actual rows= loops=)

  • Filter: (avoir_id IS NULL)
74. 0.000 0.000 ↓ 0.0

Index Scan using bien_pkey on bien (cost=0.29..0.36 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = bien_1.id)
75. 0.000 0.000 ↓ 0.0

Index Only Scan using adresse_pkey on adresse (cost=0.42..0.53 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = bien.adresse_id)
76. 0.000 0.000 ↓ 0.0

Function Scan on crosstab ct_2 (cost=0.00..10.00 rows=1,000 width=292) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

Index Only Scan using annonce_dossier_id_uniq on annonce a (cost=0.29..0.89 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (dossier_id = a_1.dossier_id)
78. 0.000 0.000 ↓ 0.0

Seq Scan on cuisine_type (cost=0.00..1.07 rows=7 width=520) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Seq Scan on chauffage_energie (cost=0.00..3.53 rows=153 width=23) (actual rows= loops=)