explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GETe

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

Sort (cost=1,796.18..1,796.19 rows=4 width=757) (actual time=11,255.446..11,258.219 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,766.944 11,150.161 ↓ 2,043.0 8,172 1

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

3. 13.186 350.529 ↓ 2,043.0 8,172 1

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

4. 7.809 312.827 ↓ 2,043.0 8,172 1

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

5. 4.161 239.642 ↓ 2,043.0 8,172 1

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

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

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

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

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

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

Nested Loop (cost=0.29..1,772.93 rows=109 width=622) (actual time=0.018..16.439 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. 182.468 182.468 ↓ 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.036 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.822 ms
Execution time : 11,259.097 ms