explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gsfv

Settings
# exclusive inclusive rows x rows loops node
1. 49,412.643 119,198.728 ↓ 12,302.0 12,302 1

Nested Loop (cost=19,496.10..430,859.37 rows=1 width=53) (actual time=2,704.628..119,198.728 rows=12,302 loops=1)

  • Join Filter: ((mm_v010101.componente)::text = (ctr_fant007.co)::text)
  • Rows Removed by Join Filter: 451567372
2. 61.826 3,922.924 ↓ 37,401.0 37,401 1

Nested Loop Left Join (cost=19,496.10..430,487.69 rows=1 width=52) (actual time=2,598.826..3,922.924 rows=37,401 loops=1)

  • Filter: (m_seriesp.serie IS NULL)
  • Rows Removed by Filter: 16490
3. 32.960 2,837.169 ↓ 361.7 53,891 1

Nested Loop (cost=19,495.67..430,323.88 rows=149 width=52) (actual time=2,028.277..2,837.169 rows=53,891 loops=1)

4. 10.618 2,679.955 ↓ 4.4 4,602 1

Nested Loop (cost=19,495.10..429,466.85 rows=1,050 width=36) (actual time=2,028.246..2,679.955 rows=4,602 loops=1)

  • Join Filter: ((m0301.codigo)::text = (masco_ftart.codigo)::text)
5. 100.025 2,597.397 ↑ 11.5 4,796 1

Hash Join (cost=19,494.68..402,321.66 rows=55,372 width=62) (actual time=2,028.214..2,597.397 rows=4,796 loops=1)

  • Hash Cond: ((v010101.articulo)::text = (m0301.codigo)::text)
6. 2,269.026 2,269.026 ↑ 19.5 98,457 1

Index Scan using v010101_pkey on v010101 (cost=0.56..363,038.45 rows=1,923,537 width=49) (actual time=0.182..2,269.026 rows=98,457 loops=1)

  • Index Cond: ((empresa = 1) AND (ejercicio = 2019) AND ((tipo_movimiento)::text = 'PV'::text))
  • Filter: (cantidad <> cantidad_s)
  • Rows Removed by Filter: 1804558
7. 10.007 228.346 ↓ 1.0 23,361 1

Hash (cost=19,204.79..19,204.79 rows=23,146 width=15) (actual time=228.346..228.346 rows=23,361 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1138kB
8. 218.339 218.339 ↓ 1.0 23,361 1

Seq Scan on m0301 (cost=0.00..19,204.79 rows=23,146 width=15) (actual time=0.048..218.339 rows=23,361 loops=1)

  • Filter: (((codigo_a)::text ~~ 'T%'::text) AND (empresa = 1))
  • Rows Removed by Filter: 781885
9. 71.940 71.940 ↑ 1.0 1 4,796

Index Scan using masco_ftart01 on masco_ftart (cost=0.42..0.48 rows=1 width=15) (actual time=0.012..0.015 rows=1 loops=4,796)

  • Index Cond: ((codigo)::text = (v010101.articulo)::text)
  • Filter: (((v010101.almacen)::text = (almfab)::text) OR ((almfab)::text = '00'::text))
  • Rows Removed by Filter: 0
10. 124.254 124.254 ↓ 12.0 12 4,602

Index Scan using mm_v010101_pkey on mm_v010101 (cost=0.56..0.81 rows=1 width=34) (actual time=0.017..0.027 rows=12 loops=4,602)

  • Index Cond: ((pedido = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = 'PV'::text) AND (ejercicio = 2019) AND (empresa = 1) AND (od_linea = v010101.od_linea))
11. 1,023.929 1,023.929 ↓ 0.0 0 53,891

Index Scan using m_seriesp_01 on m_seriesp (cost=0.43..1.09 rows=1 width=31) (actual time=0.019..0.019 rows=0 loops=53,891)

  • Index Cond: ((emp = v010101.empresa) AND (emp = 1) AND (eje = v010101.ejercicio) AND (eje = 2019) AND ((alm)::text = (v010101.almacen)::text) AND (ped = v010101.pedido) AND (odl = v010101.od_linea))
12. 65,863.161 65,863.161 ↑ 1.0 12,074 37,401

Seq Scan on ctr_fant007 (cost=0.00..220.74 rows=12,074 width=26) (actual time=0.010..1.761 rows=12,074 loops=37,401)

Planning time : 9.236 ms
Execution time : 119,201.318 ms