explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7UKw

Settings
# exclusive inclusive rows x rows loops node
1. 6.304 9,273.718 ↓ 13.5 4,143 1

Nested Loop Left Join (cost=8.36..349,726.59 rows=306 width=84) (actual time=8,682.740..9,273.718 rows=4,143 loops=1)

2. 3.843 9,246.699 ↓ 13.5 4,143 1

Nested Loop (cost=7.93..349,134.91 rows=306 width=76) (actual time=8,682.722..9,246.699 rows=4,143 loops=1)

3. 33.537 9,222.141 ↓ 13.5 4,143 1

Nested Loop Left Join (cost=7.50..348,941.48 rows=307 width=72) (actual time=8,682.688..9,222.141 rows=4,143 loops=1)

  • Filter: (vxx06cab.datof IS NULL)
  • Rows Removed by Filter: 64879
4. 194.096 8,843.494 ↓ 94.2 69,022 1

Nested Loop (cost=7.07..347,524.14 rows=733 width=64) (actual time=8,680.302..8,843.494 rows=69,022 loops=1)

5. 325.911 1,005.281 ↓ 2.2 588,009 1

Hash Join (cost=6.63..56,401.21 rows=271,505 width=46) (actual time=0.309..1,005.281 rows=588,009 loops=1)

  • Hash Cond: ((v0101.almacen)::text = (m_plazosfabrica.almacen)::text)
6. 679.103 679.103 ↑ 1.0 958,592 1

Seq Scan on v0101 (cost=0.00..50,069.75 rows=962,608 width=43) (actual time=0.013..679.103 rows=958,592 loops=1)

  • Filter: ((empresa = 1) AND ((tipo_doc)::text = 'PV'::text))
  • Rows Removed by Filter: 229675
7. 0.006 0.267 ↑ 1.0 11 1

Hash (cost=6.50..6.50 rows=11 width=3) (actual time=0.267..0.267 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
8. 0.144 0.261 ↑ 1.0 11 1

HashAggregate (cost=6.28..6.39 rows=11 width=3) (actual time=0.258..0.261 rows=11 loops=1)

  • Group Key: m_plazosfabrica.almacen
9. 0.117 0.117 ↓ 1.0 345 1

Seq Scan on m_plazosfabrica (cost=0.00..5.42 rows=342 width=3) (actual time=0.030..0.117 rows=345 loops=1)

10. 7,644.117 7,644.117 ↓ 0.0 0 588,009

Index Scan using v010101_1 on v010101 (cost=0.43..1.06 rows=1 width=35) (actual time=0.013..0.013 rows=0 loops=588,009)

  • Index Cond: ((pedido = v0101.documento) AND (pedido >= 0) AND (pedido <= 9999999) AND ((almacen)::text = (v0101.almacen)::text) AND ((tipo_movimiento)::text = 'PV'::text) AND (ejercicio = v0101.ejercicio) AND (empresa = 1))
  • Filter: ((fecha_documento >= '2019-04-29'::date) AND (fecha_documento <= '2019-05-14'::date) AND ((articulo)::text !~~ '..%'::text))
  • Rows Removed by Filter: 7
11. 345.110 345.110 ↑ 1.0 1 69,022

Index Scan using vxx06_1 on vxx06 vxx06cab (cost=0.43..1.92 rows=1 width=22) (actual time=0.005..0.005 rows=1 loops=69,022)

  • Index Cond: ((documento = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND ((tipo_doc)::text = 'PV'::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa) AND (empresa = 1) AND (tipo_dato = 10) AND (od_linea = 0))
12. 20.715 20.715 ↑ 1.0 1 4,143

Index Scan using m0301_pkey on m0301 (cost=0.42..0.62 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=4,143)

  • Index Cond: (((codigo)::text = (v010101.articulo)::text) AND (empresa = 1))
  • Filter: ((codigo_a)::text <> ALL ('{D01,Z40}'::text[]))
13. 20.715 20.715 ↑ 1.0 1 4,143

Index Scan using vxx06_1 on vxx06 (cost=0.43..1.92 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=4,143)

  • Index Cond: ((documento = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND ((tipo_doc)::text = 'PV'::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa) AND (empresa = 1) AND (tipo_dato = 10) AND (od_linea = v010101.od_linea))
Planning time : 10.797 ms
Execution time : 9,274.565 ms