explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Sjs

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 2,244.833 ↑ 713,803.0 1 1

Merge Left Join (cost=312,150.16..329,162.38 rows=713,803 width=2) (actual time=2,244.831..2,244.833 rows=1 loops=1)

  • Merge Cond: (a00.emp = m020901.empresa)
  • Join Filter: ((m020901.subcta)::text = (masco_ftart.subcta_p)::text)
  • Rows Removed by Join Filter: 47
2. 30.378 2,242.262 ↑ 713,803.0 1 1

Merge Left Join (cost=311,786.82..322,267.75 rows=713,803 width=11) (actual time=2,242.261..2,242.262 rows=1 loops=1)

  • Merge Cond: ((a00.emp = m0302.empresa) AND ((a00.familia)::text = (m0302.codigo)::text))
3. 0.020 410.390 ↑ 713,803.0 1 1

Sort (cost=218,606.97..220,391.47 rows=713,803 width=43) (actual time=410.390..410.390 rows=1 loops=1)

  • Sort Key: a00.emp, a00.familia
  • Sort Method: quicksort Memory: 25kB
4. 35.202 410.370 ↑ 713,803.0 1 1

Merge Left Join (cost=2,243.87..149,206.88 rows=713,803 width=43) (actual time=410.361..410.370 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (m0315.codigo)::text)
  • Join Filter: ((m0315.empresa = a00.emp) AND ((m0315.subcta)::text = (masco_ftart.subcta_p)::text))
  • Rows Removed by Join Filter: 2
5. 0.000 0.063 ↑ 713,803.0 1 1

Merge Left Join (cost=2,243.32..15,284.34 rows=713,803 width=67) (actual time=0.057..0.063 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (a07.co)::text)
6. 0.001 0.061 ↑ 104,971.0 1 1

Merge Left Join (cost=2,148.94..4,220.49 rows=104,971 width=67) (actual time=0.055..0.061 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (r01.art)::text)
7. 0.002 0.058 ↑ 22,334.0 1 1

Merge Left Join (cost=2,083.12..2,524.28 rows=22,334 width=67) (actual time=0.052..0.058 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (a01.co)::text)
8. 0.002 0.051 ↑ 4,752.0 1 1

Merge Left Join (cost=2,017.30..2,111.57 rows=4,752 width=67) (actual time=0.047..0.051 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (a02.art)::text)
9. 0.004 0.044 ↑ 1,188.0 1 1

Merge Left Join (cost=1,960.73..1,980.75 rows=1,188 width=67) (actual time=0.043..0.044 rows=1 loops=1)

  • Merge Cond: ((a00.co)::text = (a04.art)::text)
10. 0.004 0.027 ↑ 440.0 1 1

Sort (cost=1,920.82..1,921.92 rows=440 width=67) (actual time=0.027..0.027 rows=1 loops=1)

  • Sort Key: a00.co
  • Sort Method: quicksort Memory: 25kB
11. 0.002 0.023 ↑ 440.0 1 1

Nested Loop Left Join (cost=0.42..1,901.50 rows=440 width=67) (actual time=0.022..0.023 rows=1 loops=1)

12. 0.004 0.004 ↑ 440.0 1 1

Seq Scan on a00 (cost=0.00..14.40 rows=440 width=58) (actual time=0.003..0.004 rows=1 loops=1)

13. 0.017 0.017 ↑ 1.0 1 1

Index Scan using masco_ftart01 on masco_ftart (cost=0.42..4.28 rows=1 width=23) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: ((codigo)::text = (a00.co)::text)
14. 0.005 0.013 ↑ 540.0 1 1

Sort (cost=39.91..41.26 rows=540 width=24) (actual time=0.012..0.013 rows=1 loops=1)

  • Sort Key: a04.art
  • Sort Method: quicksort Memory: 25kB
15. 0.008 0.008 ↑ 540.0 1 1

Seq Scan on a04 (cost=0.00..15.40 rows=540 width=24) (actual time=0.008..0.008 rows=1 loops=1)

16. 0.004 0.005 ↑ 800.0 1 1

Sort (cost=56.58..58.58 rows=800 width=24) (actual time=0.004..0.005 rows=1 loops=1)

  • Sort Key: a02.art
  • Sort Method: quicksort Memory: 25kB
17. 0.001 0.001 ↑ 800.0 1 1

Seq Scan on a02 (cost=0.00..18.00 rows=800 width=24) (actual time=0.001..0.001 rows=1 loops=1)

18. 0.003 0.005 ↑ 940.0 1 1

Sort (cost=65.82..68.17 rows=940 width=24) (actual time=0.004..0.005 rows=1 loops=1)

  • Sort Key: a01.co
  • Sort Method: quicksort Memory: 25kB
19. 0.002 0.002 ↑ 940.0 1 1

Seq Scan on a01 (cost=0.00..19.40 rows=940 width=24) (actual time=0.002..0.002 rows=1 loops=1)

20. 0.002 0.002 ↓ 0.0 0 1

Sort (cost=65.82..68.17 rows=940 width=24) (actual time=0.002..0.002 rows=0 loops=1)

  • Sort Key: r01.art
  • Sort Method: quicksort Memory: 25kB
21. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on r01 (cost=0.00..19.40 rows=940 width=24) (actual time=0.000..0.000 rows=0 loops=1)

22. 0.002 0.002 ↓ 0.0 0 1

Sort (cost=94.38..97.78 rows=1,360 width=24) (actual time=0.002..0.002 rows=0 loops=1)

  • Sort Key: a07.co
  • Sort Method: quicksort Memory: 25kB
23. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on a07 (cost=0.00..23.60 rows=1,360 width=24) (actual time=0.000..0.000 rows=0 loops=1)

24. 62.358 375.105 ↑ 6.6 135,019 1

Materialize (cost=0.55..66,369.01 rows=892,187 width=26) (actual time=0.112..375.105 rows=135,019 loops=1)

25. 312.747 312.747 ↑ 6.6 135,019 1

Index Only Scan using m0315_2 on m0315 (cost=0.55..64,138.55 rows=892,187 width=26) (actual time=0.109..312.747 rows=135,019 loops=1)

  • Index Cond: ((fecha_inicio <= '2019-06-12'::date) AND (fecha_final >= '2019-06-12'::date) AND (desde_cantidad <= 1::numeric) AND (hasta_cantidad >= 1::numeric))
  • Heap Fetches: 135019
26. 1,509.819 1,801.494 ↑ 3.1 219,802 1

Sort (cost=93,179.85..94,868.71 rows=675,544 width=16) (actual time=1,777.493..1,801.494 rows=219,802 loops=1)

  • Sort Key: m0302.empresa, m0302.codigo
  • Sort Method: quicksort Memory: 70150kB
27. 291.675 291.675 ↓ 1.0 680,090 1

Seq Scan on m0302 (cost=0.00..27,767.97 rows=675,544 width=16) (actual time=0.015..291.675 rows=680,090 loops=1)

  • Filter: (tipo = 0)
  • Rows Removed by Filter: 457321
28. 0.027 2.556 ↑ 1.6 48 1

Sort (cost=363.33..363.52 rows=76 width=11) (actual time=2.554..2.556 rows=48 loops=1)

  • Sort Key: m020901.empresa
  • Sort Method: quicksort Memory: 27kB
29. 2.529 2.529 ↑ 1.6 48 1

Seq Scan on m020901 (cost=0.00..360.96 rows=76 width=11) (actual time=2.289..2.529 rows=48 loops=1)

  • Filter: (((almacen)::text = '25'::text) AND (tipo_obs = 90) AND (numero_obs = 1))
  • Rows Removed by Filter: 14064
Planning time : 3.820 ms
Execution time : 2,252.312 ms