explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dc9s

Settings
# exclusive inclusive rows x rows loops node
1. 5.213 719.554 ↓ 17.6 4,143 1

Nested Loop Left Join (cost=8.79..48,754.45 rows=235 width=84) (actual time=186.215..719.554 rows=4,143 loops=1)

2. 1.399 697.769 ↓ 17.6 4,143 1

Nested Loop (cost=8.35..48,636.63 rows=235 width=76) (actual time=186.198..697.769 rows=4,143 loops=1)

3. 63.839 679.798 ↓ 17.6 4,143 1

Nested Loop Left Join (cost=7.93..48,527.95 rows=235 width=72) (actual time=186.166..679.798 rows=4,143 loops=1)

  • Filter: (vxx06cab.datof IS NULL)
  • Rows Removed by Filter: 64898
4. 40.465 339.795 ↓ 122.8 69,041 1

Nested Loop (cost=7.50..48,246.20 rows=562 width=64) (actual time=184.278..339.795 rows=69,041 loops=1)

5. 4.919 214.163 ↓ 3.1 9,463 1

Hash Join (cost=7.06..35,542.74 rows=3,056 width=46) (actual time=184.225..214.163 rows=9,463 loops=1)

  • Hash Cond: ((v0101.almacen)::text = (m_plazosfabrica.almacen)::text)
6. 208.998 208.998 ↓ 1.3 13,558 1

Index Scan using v0101_3 on v0101 (cost=0.43..35,464.92 rows=10,835 width=43) (actual time=183.947..208.998 rows=13,558 loops=1)

  • Index Cond: ((empresa = 1) AND ((tipo_doc)::text = 'PV'::text) AND (fecha_documento >= '2019-04-29'::date) AND (fecha_documento <= '2019-05-14'::date))
  • Filter: ((documento >= 0) AND (documento <= 9999999))
7. 0.007 0.246 ↑ 1.0 11 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
8. 0.145 0.239 ↑ 1.0 11 1

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

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

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

10. 85.167 85.167 ↓ 7.0 7 9,463

Index Scan using v010101_1 on v010101 (cost=0.43..4.15 rows=1 width=35) (actual time=0.006..0.009 rows=7 loops=9,463)

  • Index Cond: ((pedido = v0101.documento) AND ((almacen)::text = (v0101.almacen)::text) AND ((tipo_movimiento)::text = 'PV'::text) AND (ejercicio = v0101.ejercicio) AND (empresa = 1))
  • Filter: ((articulo)::text !~~ '..%'::text)
  • Rows Removed by Filter: 0
11. 276.164 276.164 ↑ 1.0 1 69,041

Index Scan using vxx06_1 on vxx06 vxx06cab (cost=0.43..0.49 rows=1 width=22) (actual time=0.004..0.004 rows=1 loops=69,041)

  • 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. 16.572 16.572 ↑ 1.0 1 4,143

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

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

Index Scan using vxx06_1 on vxx06 (cost=0.43..0.49 rows=1 width=26) (actual time=0.004..0.004 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 : 8.348 ms
Execution time : 720.115 ms