explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ySYx

Settings
# exclusive inclusive rows x rows loops node
1. 93.871 8,511.301 ↓ 2,043.0 8,172 1

Sort (cost=1,796.55..1,796.56 rows=4 width=757) (actual time=8,508.962..8,511.301 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: 8480kB
2. 8,065.715 8,417.430 ↓ 2,043.0 8,172 1

Nested Loop (cost=1.15..1,796.51 rows=4 width=757) (actual time=4.749..8,417.430 rows=8,172 loops=1)

3. 8.858 327.199 ↓ 2,043.0 8,172 1

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

4. 6.601 293.825 ↓ 2,043.0 8,172 1

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

5. 4.055 230.020 ↓ 2,043.0 8,172 1

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

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

Seq Scan on d_periode_modification pm (cost=0.00..1.02 rows=1 width=8) (actual time=0.019..0.020 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. 20.732 225.945 ↓ 2,043.0 8,172 1

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

  • Join Filter: (e.tk_programme_activite = pa.tk_programme_activite)
  • Rows Removed by Join Filter: 179860
8. 0.138 0.138 ↓ 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.138 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. 28.314 205.075 ↓ 132.7 14,464 13

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

10. 0.169 0.169 ↑ 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.013 rows=1 loops=13)

  • Filter: ((code_combinaison)::text = '{C,P}'::text)
  • Rows Removed by Filter: 3
11. 176.592 176.592 ↓ 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.010..13.584 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. 57.204 57.204 ↑ 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.007..0.007 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. 24.516 24.516 ↑ 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.003 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 : 8.471 ms
Execution time : 8,512.195 ms