explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xw7K

Settings
# exclusive inclusive rows x rows loops node
1. 109.815 11,249.410 ↓ 2,043.0 8,172 1

Sort (cost=1,796.18..1,796.19 rows=4 width=757) (actual time=11,246.694..11,249.410 rows=8,172 loops=1)

  • Sort Key: cb.libelle_secteur_uo, cb.libelle_map, cb.code_bop, cb.code_type_uo, cb.libelle_uo, pa.libelle_activite, (((a.nom || ' '::text) || a.prenom))
  • Sort Method: quicksort Memory: 11112kB
2. 10,749.358 11,139.595 ↓ 2,043.0 8,172 1

Nested Loop (cost=1.15..1,796.14 rows=4 width=757) (actual time=5.306..11,139.595 rows=8,172 loops=1)

3. 12.682 357.549 ↓ 2,043.0 8,172 1

Nested Loop (cost=0.87..1,788.79 rows=4 width=691) (actual time=2.111..357.549 rows=8,172 loops=1)

4. 9.188 320.351 ↓ 2,043.0 8,172 1

Nested Loop (cost=0.58..1,784.19 rows=4 width=688) (actual time=2.101..320.351 rows=8,172 loops=1)

5. 4.209 245.787 ↓ 2,043.0 8,172 1

Nested Loop (cost=0.29..1,777.09 rows=4 width=670) (actual time=2.089..245.787 rows=8,172 loops=1)

  • Join Filter: (e.tk_periode_modification = pm.tk_periode_modification)
6. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on d_periode_modification pm (cost=0.00..1.02 rows=1 width=8) (actual time=0.020..0.021 rows=1 loops=1)

  • Filter: (((to_date('06-09-2019'::text, 'dd-mm-yyyy'::text) >= date_debut) AND (to_date('06-09-2019'::text, 'dd-mm-yyyy'::text) <= date_fin)) OR ((to_date('06-09-2019'::text, 'dd-mm-yyyy'::text) > date_fin) AND est_derniere))
7. 22.023 241.557 ↓ 2,043.0 8,172 1

Nested Loop (cost=0.29..1,776.01 rows=4 width=678) (actual time=2.063..241.557 rows=8,172 loops=1)

  • Join Filter: (e.tk_programme_activite = pa.tk_programme_activite)
  • Rows Removed by Join Filter: 179860
8. 0.133 0.133 ↓ 13.0 13 1

Seq Scan on d_programme_activite pa (cost=0.00..1.72 rows=1 width=72) (actual time=0.020..0.133 rows=13 loops=1)

  • Filter: ((code_programme = '215'::text) AND (tk_programme_activite = ANY (('{12,13,14,15,16,19,17,18,20,21,22,24,23}'::text[])::bigint[])))
  • Rows Removed by Filter: 11
9. 30.966 219.401 ↓ 132.7 14,464 13

Nested Loop (cost=0.29..1,772.93 rows=109 width=622) (actual time=0.018..16.877 rows=14,464 loops=13)

10. 0.234 0.234 ↑ 1.0 1 13

Seq Scan on d_statut_evenement_combinaison sec (cost=0.00..1.07 rows=1 width=8) (actual time=0.004..0.018 rows=1 loops=13)

  • Filter: ((code_combinaison)::text = '{C,P}'::text)
  • Rows Removed by Filter: 3
11. 188.201 188.201 ↓ 132.7 14,464 13

Index Scan using rpt_01_idx_statut_evenement_combinaison on rpt_01_synthese_mensuelle_comsommation_etp e (cost=0.29..1,770.77 rows=109 width=630) (actual time=0.011..14.477 rows=14,464 loops=13)

  • Index Cond: (tk_statut_evenement_combinaison = sec.tk_statut_evenement_combinaison)
  • Filter: (((categorie)::text = ANY ('{A,B,C,Z}'::text[])) AND (('[20181201,20211231)'::int8range && int8range(tk_date_debut, tk_date_fin)) OR ('[20181201,20211231)'::int8range -|- int8range(tk_date_debut, tk_date_ (...)
12. 65.376 65.376 ↑ 1.0 1 8,172

Index Scan using d_agent_pk on d_agent a (cost=0.29..1.76 rows=1 width=34) (actual time=0.008..0.008 rows=1 loops=8,172)

  • Index Cond: (tk_agent = e.tk_agent)
13. 24.516 24.516 ↑ 1.0 1 8,172

Index Scan using d_poste_pk on d_poste p (cost=0.29..1.14 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=8,172)

  • Index Cond: (tk_poste = e.tk_poste)
14. 32.688 32.688 ↑ 1.0 1 8,172

Index Scan using d_cartographie_bop_pk on d_cartographie_bop cb (cost=0.28..0.57 rows=1 width=82) (actual time=0.003..0.004 rows=1 loops=8,172)

  • Index Cond: (tk_cartographie_bop = e.tk_cartographie_bop)
  • Filter: (code_secteur_uo = ANY ('{1,2,3}'::text[]))
Planning time : 9.552 ms
Execution time : 11,250.401 ms