explain.depesz.com

PostgreSQL's explain analyze made readable

Result: niR

Settings
# exclusive inclusive rows x rows loops node
1. 106.834 9,351.891 ↓ 2,043.0 8,172 1

Sort (cost=1,795.44..1,795.45 rows=4 width=757) (actual time=9,349.622..9,351.891 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: 8492kB
2. 8,817.279 9,245.057 ↓ 2,043.0 8,172 1

Nested Loop (cost=1.15..1,795.40 rows=4 width=757) (actual time=5.150..9,245.057 rows=8,172 loops=1)

3. 10.403 395.090 ↓ 2,043.0 8,172 1

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

4. 10.854 351.999 ↓ 2,043.0 8,172 1

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

5. 4.747 267.597 ↓ 2,043.0 8,172 1

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

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

Seq Scan on d_periode_modification pm (cost=0.00..1.02 rows=1 width=8) (actual time=0.023..0.024 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. 24.014 262.826 ↓ 2,043.0 8,172 1

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

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

Seq Scan on d_programme_activite pa (cost=0.00..1.72 rows=1 width=72) (actual time=0.022..0.145 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. 33.267 238.667 ↓ 132.7 14,464 13

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

10. 0.195 0.195 ↑ 1.0 1 13

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

  • Filter: ((code_combinaison)::text = '{C,P}'::text)
  • Rows Removed by Filter: 3
11. 205.205 205.205 ↓ 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..15.785 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. 73.548 73.548 ↑ 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.009..0.009 rows=1 loops=8,172)

  • Index Cond: (tk_agent = e.tk_agent)
13. 32.688 32.688 ↑ 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.004 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 : 13.911 ms
Execution time : 9,352.777 ms