explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zt0P

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

Hash Join (cost=231,319.18..477,250.67 rows=23,778 width=720) (actual rows= loops=)

  • Hash Cond: (prf.cod_loc = loc.cod_loc)
2.          

Initplan (for Hash Join)

3. 0.000 0.000 ↓ 0.0

Index Scan using t_lda_maes_fechas_hzt_pkey on t_lda_maes_fechas_hzt (cost=0.28..8.29 rows=1 width=2) (actual rows= loops=)

  • Index Cond: (fecha = '2020-01-07 00:00:00'::timestamp without time zone)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=228,065.40..473,781.45 rows=15,092 width=702) (actual rows= loops=)

  • Join Filter: (art_com.cod_articulo = prf.cod_articulo)
5.          

CTE articulo

6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on t_lda_maes_art_estr_com (cost=17,696.86..23,761.18 rows=1,629 width=31) (actual rows= loops=)

  • Recheck Cond: (((cod_n1)::text = ANY ('{0001,0002,0003,0004,0005,0008}'::text[])) AND ((cod_n2)::text = '0001'::text) AND (nivel = '5'::numeric) AND (cod_est_art = ANY ('{1,2,3}'::numeric[])))
7. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=17,696.86..17,696.86 rows=1,629 width=0) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on t_lda_maes_art_estr_com_i2 (cost=0.00..663.48 rows=25,211 width=0) (actual rows= loops=)

  • Index Cond: (((cod_n1)::text = ANY ('{0001,0002,0003,0004,0005,0008}'::text[])) AND ((cod_n2)::text = '0001'::text))
9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on t_lda_maes_art_estr_com_i3 (cost=0.00..17,032.32 rows=703,100 width=0) (actual rows= loops=)

  • Index Cond: ((nivel = '5'::numeric) AND (cod_est_art = ANY ('{1,2,3}'::numeric[])))
10. 0.000 0.000 ↓ 0.0

Hash Join (cost=204,303.66..206,986.59 rows=38,413 width=140) (actual rows= loops=)

  • Hash Cond: (art_com.cod_articulo = crr.cod_articulo)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..57.16 rows=1,629 width=121) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using t_lda_maes_fechas_hzt_pkey on t_lda_maes_fechas_hzt fec (cost=0.28..8.29 rows=1 width=5) (actual rows= loops=)

  • Index Cond: (fecha = '2020-01-07 00:00:00'::timestamp without time zone)
13. 0.000 0.000 ↓ 0.0

CTE Scan on articulo art_com (cost=0.00..32.58 rows=1,629 width=116) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=196,793.16..196,793.16 rows=600,818 width=19) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on t_lda_maes_cen_ref_rdf crr (cost=0.00..196,793.16 rows=600,818 width=19) (actual rows= loops=)

  • Filter: (('2020-01-07 00:00:00'::timestamp without time zone >= trunc(activo)) AND ('2020-01-07 00:00:00'::timestamp without time zone < trunc(inactivo)))
16. 0.000 0.000 ↓ 0.0

Index Scan using t_lda_approved_forecast_f21_pkey on t_lda_approved_forecast_f21 prf (cost=0.56..4.46 rows=1 width=533) (actual rows= loops=)

  • Index Cond: ((fec_ini_sem = ('2020-01-07 00:00:00'::timestamp without time zone - '1'::numeric)) AND (cod_loc = crr.cod_loc) AND (cod_articulo = crr.cod_articulo))
17.          

SubPlan (for Nested Loop)

18. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.45..4.46 rows=1 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Only Scan using t_lda_prev_promo_i1 on t_lda_prev_promo (cost=0.43..4.45 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((cod_loc = prf.cod_loc) AND (cod_articulo = prf.cod_articulo))
20. 0.000 0.000 ↓ 0.0

Hash (cost=3,196.78..3,196.78 rows=3,896 width=29) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Join (cost=338.44..3,196.78 rows=3,896 width=29) (actual rows= loops=)

  • Hash Cond: (ln.cod_nivel_estr_loc = nel.cod_nivel_estr_loc)
22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=94.90..2,904.07 rows=3,896 width=17) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on loc_nel ln (cost=94.61..860.31 rows=3,896 width=11) (actual rows= loops=)

  • Recheck Cond: (cod_tp_estr_loc = '29'::numeric)
24. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on loc_nel_pkey (cost=0.00..93.64 rows=3,896 width=0) (actual rows= loops=)

  • Index Cond: (cod_tp_estr_loc = '29'::numeric)
25. 0.000 0.000 ↓ 0.0

Index Only Scan using localizaciones_pkey on localizaciones loc (cost=0.29..0.52 rows=1 width=6) (actual rows= loops=)

  • Index Cond: (cod_loc = ln.cod_loc)
26. 0.000 0.000 ↓ 0.0

Hash (cost=174.35..174.35 rows=5,535 width=24) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on niveles_estr_loc nel (cost=0.00..174.35 rows=5,535 width=24) (actual rows= loops=)