explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QM9L

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

Result (cost=21,766.88..21,766.90 rows=1 width=32) (actual rows= loops=)

2.          

Initplan (forResult)

3. 0.000 0.000 ↓ 0.0

Aggregate (cost=10,944.63..10,944.64 rows=1 width=32) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,617.61..8,721.63 rows=7,600 width=119) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Subquery Scan on qry_70_71_n (cost=269.38..269.41 rows=1 width=32) (actual rows= loops=)

  • Filter: (qry_70_71_n.solde_n_70_71 <> '0'::numeric)
6. 0.000 0.000 ↓ 0.0

Aggregate (cost=269.38..269.39 rows=1 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..267.87 rows=3 width=10) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..240.85 rows=87 width=18) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..94.43 rows=21 width=8) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
11. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec (cost=0.42..91.03 rows=97 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et.id_etablissement) AND (date_piece >= '2019-01-01'::date) AND (date_piece <= '2019-12-31'::date))
12. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le (cost=0.42..6.07 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec.id_ecriture)
13. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le.id_compte)
  • Filter: ((no_compte)::text ~~ ANY ('{70%,71%}'::text[]))
14. 0.000 0.000 ↓ 0.0

Subquery Scan on qry_avec_solde_0 (cost=4,348.22..8,376.22 rows=7,600 width=87) (actual rows= loops=)

  • Filter: ((qry_avec_solde_0.solde_n <> '0'::numeric) OR (qry_avec_solde_0.solde_n_1 <> '0'::numeric))
15. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,348.22..8,262.22 rows=7,600 width=87) (actual rows= loops=)

  • Group Key: c_1.no_compte, c_1.intitule_co
16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,999.58..3,972.53 rows=37,569 width=87) (actual rows= loops=)

  • Hash Cond: (c_1.id_compte = c_3.id_compte)
17. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,722.57..3,596.89 rows=37,569 width=63) (actual rows= loops=)

  • Hash Cond: (c_1.id_compte = c_2.id_compte)
18. 0.000 0.000 ↓ 0.0

Seq Scan on compte c_1 (cost=0.00..775.69 rows=37,569 width=31) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=2,719.67..2,719.67 rows=232 width=40) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=2,596.13..2,717.35 rows=232 width=40) (actual rows= loops=)

  • Group Key: c_2.id_compte
21. 0.000 0.000 ↓ 0.0

Sort (cost=2,596.13..2,596.71 rows=232 width=18) (actual rows= loops=)

  • Sort Key: c_2.id_compte
22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..2,587.01 rows=232 width=18) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..2,191.38 rows=1,269 width=18) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..1,123.47 rows=311 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et_1 (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
26. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec_1 (cost=0.42..1,106.87 rows=1,418 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et_1.id_etablissement) AND (date_piece >= '2018-01-01'::date) AND (date_piece <= '2018-12-31'::date))
27. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le_1 (cost=0.42..2.53 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec_1.id_ecriture)
28. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c_2 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le_1.id_compte)
  • Filter: ((no_compte)::text ~~ ANY ('{41%,49%,487%}'::text[]))
29. 0.000 0.000 ↓ 0.0

Hash (cost=276.82..276.82 rows=16 width=40) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=268.30..276.66 rows=16 width=40) (actual rows= loops=)

  • Group Key: c_3.id_compte
31. 0.000 0.000 ↓ 0.0

Sort (cost=268.30..268.34 rows=16 width=18) (actual rows= loops=)

  • Sort Key: c_3.id_compte
32. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..267.98 rows=16 width=18) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..240.85 rows=87 width=18) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..94.43 rows=21 width=8) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et_2 (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
36. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec_2 (cost=0.42..91.03 rows=97 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et_2.id_etablissement) AND (date_piece >= '2019-01-01'::date) AND (date_piece <= '2019-12-31'::date))
37. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le_2 (cost=0.42..6.07 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec_2.id_ecriture)
38. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c_3 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le_2.id_compte)
  • Filter: ((no_compte)::text ~~ ANY ('{41%,49%,487%}'::text[]))
39. 0.000 0.000 ↓ 0.0

Aggregate (cost=10,822.23..10,822.24 rows=1 width=32) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,495.20..8,599.23 rows=7,600 width=119) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Subquery Scan on qry_70_71_n_1 (cost=269.38..269.41 rows=1 width=32) (actual rows= loops=)

  • Filter: (qry_70_71_n_1.solde_n_70_71 <> '0'::numeric)
42. 0.000 0.000 ↓ 0.0

Aggregate (cost=269.38..269.39 rows=1 width=32) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..267.87 rows=3 width=10) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..240.85 rows=87 width=18) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..94.43 rows=21 width=8) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et_3 (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
47. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec_3 (cost=0.42..91.03 rows=97 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et_3.id_etablissement) AND (date_piece >= '2019-01-01'::date) AND (date_piece <= '2019-12-31'::date))
48. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le_3 (cost=0.42..6.07 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec_3.id_ecriture)
49. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c_4 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le_3.id_compte)
  • Filter: ((no_compte)::text ~~ ANY ('{70%,71%}'::text[]))
50. 0.000 0.000 ↓ 0.0

Subquery Scan on qry_avec_solde_0_1 (cost=4,225.82..8,253.82 rows=7,600 width=87) (actual rows= loops=)

  • Filter: ((qry_avec_solde_0_1.solde_n <> '0'::numeric) OR (qry_avec_solde_0_1.solde_n_1 <> '0'::numeric))
51. 0.000 0.000 ↓ 0.0

HashAggregate (cost=4,225.82..8,139.82 rows=7,600 width=87) (actual rows= loops=)

  • Group Key: c_5.no_compte, c_5.intitule_co
52. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,877.18..3,850.13 rows=37,569 width=87) (actual rows= loops=)

  • Hash Cond: (c_5.id_compte = c_7.id_compte)
53. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,607.99..3,482.31 rows=37,569 width=63) (actual rows= loops=)

  • Hash Cond: (c_5.id_compte = c_6.id_compte)
54. 0.000 0.000 ↓ 0.0

Seq Scan on compte c_5 (cost=0.00..775.69 rows=37,569 width=31) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Hash (cost=2,607.57..2,607.57 rows=34 width=40) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=2,589.46..2,607.23 rows=34 width=40) (actual rows= loops=)

  • Group Key: c_6.id_compte
57. 0.000 0.000 ↓ 0.0

Sort (cost=2,589.46..2,589.55 rows=34 width=18) (actual rows= loops=)

  • Sort Key: c_6.id_compte
58. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..2,588.60 rows=34 width=18) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..2,191.38 rows=1,269 width=18) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..1,123.47 rows=311 width=8) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et_4 (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
62. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec_4 (cost=0.42..1,106.87 rows=1,418 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et_4.id_etablissement) AND (date_piece >= '2018-01-01'::date) AND (date_piece <= '2018-12-31'::date))
63. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le_4 (cost=0.42..2.53 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec_4.id_ecriture)
64. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c_6 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le_4.id_compte)
  • Filter: ((no_compte)::text ~~ ANY ('{70%,654%,68174%,78174%}'::text[]))
65. 0.000 0.000 ↓ 0.0

Hash (cost=269.16..269.16 rows=2 width=40) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=268.09..269.14 rows=2 width=40) (actual rows= loops=)

  • Group Key: c_7.id_compte
67. 0.000 0.000 ↓ 0.0

Sort (cost=268.09..268.10 rows=2 width=18) (actual rows= loops=)

  • Sort Key: c_7.id_compte
68. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..268.08 rows=2 width=18) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..240.85 rows=87 width=18) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..94.43 rows=21 width=8) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Seq Scan on etablissement et_5 (cost=0.00..2.42 rows=1 width=8) (actual rows= loops=)

  • Filter: (id_societe = 37)
72. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ecriture_1 on ecriture ec_5 (cost=0.42..91.03 rows=97 width=16) (actual rows= loops=)

  • Index Cond: ((id_etablissement = et_5.id_etablissement) AND (date_piece >= '2019-01-01'::date) AND (date_piece <= '2019-12-31'::date))
73. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_ligne_ecriture_2 on ligne_ecriture le_5 (cost=0.42..6.07 rows=90 width=26) (actual rows= loops=)

  • Index Cond: (id_ecriture = ec_5.id_ecriture)
74. 0.000 0.000 ↓ 0.0

Index Scan using ndx_sch1_sch_compte_3 on compte c_7 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_compte = le_5.id_compte)