explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2yhv

Settings
# exclusive inclusive rows x rows loops node
1. 2,658.534 4,077.395 ↑ 2.7 32,895 1

Hash Left Join (cost=47,396.88..145,700.58 rows=89,876 width=1,340) (actual time=100.374..4,077.395 rows=32,895 loops=1)

  • Hash Cond: (pro.pro_id = saldoinv.pro_id)
2. 107.706 1,401.852 ↑ 2.7 32,895 1

Hash Left Join (cost=7,259.92..62,972.22 rows=89,876 width=1,124) (actual time=83.192..1,401.852 rows=32,895 loops=1)

  • Hash Cond: ((pro.pro_id = dlp.pro_id) AND (cli.lpr_id = dlp.lpr_id))
3. 25.029 1,269.506 ↑ 2.7 32,895 1

Hash Left Join (cost=5,410.17..35,125.61 rows=89,876 width=1,122) (actual time=58.481..1,269.506 rows=32,895 loops=1)

  • Hash Cond: (pro.ubi_id = ubi2.ubi_id)
4. 26.589 1,243.655 ↑ 2.7 32,895 1

Hash Left Join (cost=5,350.97..34,829.89 rows=89,876 width=1,110) (actual time=57.649..1,243.655 rows=32,895 loops=1)

  • Hash Cond: (pro.mar_id = mar.mar_id)
5. 28.312 1,217.009 ↑ 2.7 32,895 1

Hash Left Join (cost=5,348.57..34,575.44 rows=89,876 width=1,108) (actual time=57.578..1,217.009 rows=32,895 loops=1)

  • Hash Cond: (pro.pro_id = buf.pro_id)
6. 32.931 1,186.667 ↑ 2.7 32,895 1

Hash Left Join (cost=4,787.80..33,778.63 rows=89,876 width=1,104) (actual time=55.525..1,186.667 rows=32,895 loops=1)

  • Hash Cond: (pro.pro_id = pim.pro_id)
7. 30.307 1,152.031 ↑ 2.7 32,895 1

Hash Left Join (cost=4,659.52..33,414.23 rows=89,876 width=1,084) (actual time=53.807..1,152.031 rows=32,895 loops=1)

  • Hash Cond: (pro1.prod1_id = abc2.prod1_id)
8. 29.660 1,120.174 ↑ 2.7 32,895 1

Hash Left Join (cost=4,539.25..33,057.84 rows=89,876 width=1,084) (actual time=52.243..1,120.174 rows=32,895 loops=1)

  • Hash Cond: (pro1.prod1_id = abc1.prod1_id)
9. 21.979 1,088.947 ↑ 2.7 32,895 1

Hash Left Join (cost=4,415.16..32,697.62 rows=89,876 width=1,080) (actual time=50.664..1,088.947 rows=32,895 loops=1)

  • Hash Cond: (jef.emp_id = emp2.emp_id)
10. 28.097 1,066.931 ↑ 2.7 32,895 1

Hash Left Join (cost=4,412.41..32,446.13 rows=89,876 width=1,078) (actual time=50.621..1,066.931 rows=32,895 loops=1)

  • Hash Cond: (cli.ubi_id = ubi.ubi_id)
11. 23.400 1,038.183 ↑ 2.7 32,895 1

Hash Left Join (cost=4,353.20..32,150.41 rows=89,876 width=1,066) (actual time=49.963..1,038.183 rows=32,895 loops=1)

  • Hash Cond: (pro1.cla2_id = cla2.cla2_id)
12. 47.893 1,014.767 ↑ 2.7 32,895 1

Hash Left Join (cost=4,351.84..31,850.63 rows=89,876 width=652) (actual time=49.937..1,014.767 rows=32,895 loops=1)

  • Hash Cond: ("left"((pro.pro_codigo)::text, 2) = (cla1.cla1_codigo)::text)
13. 22.960 966.673 ↑ 2.7 32,895 1

Hash Left Join (cost=4,336.87..30,487.53 rows=89,876 width=637) (actual time=49.723..966.673 rows=32,895 loops=1)

  • Hash Cond: (dpe.uni_id = uni.uni_id)
14. 33.085 943.699 ↑ 2.7 32,895 1

Hash Left Join (cost=4,335.76..30,050.52 rows=89,876 width=637) (actual time=49.687..943.699 rows=32,895 loops=1)

  • Hash Cond: (pro.pro_id = pro1.pro_id)
15. 21.536 906.197 ↑ 2.7 32,895 1

Hash Left Join (cost=3,974.32..28,453.28 rows=89,876 width=625) (actual time=45.257..906.197 rows=32,895 loops=1)

  • Hash Cond: (dpe.bod_id = bod.bod_id)
16. 26.735 884.640 ↑ 2.7 32,895 1

Hash Left Join (cost=3,972.96..28,153.51 rows=89,876 width=211) (actual time=45.227..884.640 rows=32,895 loops=1)

  • Hash Cond: (dpe.pro_id = pro.pro_id)
17. 21.286 853.999 ↑ 2.7 32,895 1

Hash Left Join (cost=3,607.36..27,551.78 rows=89,876 width=131) (actual time=41.304..853.999 rows=32,895 loops=1)

  • Hash Cond: (emp.ent_id = ent2.ent_id)
18. 19.106 830.265 ↑ 2.7 32,895 1

Hash Left Join (cost=3,379.39..27,087.73 rows=89,876 width=108) (actual time=38.843..830.265 rows=32,895 loops=1)

  • Hash Cond: (cpe.vnd_id = emp.emp_id)
19. 23.062 811.124 ↑ 2.7 32,895 1

Hash Left Join (cost=3,376.63..26,836.23 rows=89,876 width=108) (actual time=38.800..811.124 rows=32,895 loops=1)

  • Hash Cond: (cli.ent_id = ent.ent_id)
20. 25.968 785.420 ↑ 2.7 32,895 1

Hash Left Join (cost=3,148.66..26,372.18 rows=89,876 width=85) (actual time=36.142..785.420 rows=32,895 loops=1)

  • Hash Cond: (cpe.cli_id = cli.cli_id)
21. 230.049 756.805 ↑ 2.7 32,895 1

Hash Join (cost=2,884.51..25,871.95 rows=89,876 width=77) (actual time=33.473..756.805 rows=32,895 loops=1)

  • Hash Cond: (dpe.cpe_id = cpe.cpe_id)
22. 493.527 493.527 ↓ 1.7 437,720 1

Seq Scan on dpedido dpe (cost=0.00..22,315.26 rows=256,050 width=36) (actual time=0.018..493.527 rows=437,720 loops=1)

  • Filter: ((dpe_cantidad - COALESCE(dpe_cant_facturada, '0'::numeric)) > '0'::numeric)
  • Rows Removed by Filter: 318584
23. 13.940 33.229 ↓ 1.6 33,804 1

Hash (cost=2,616.95..2,616.95 rows=21,405 width=45) (actual time=33.229..33.229 rows=33,804 loops=1)

  • Buckets: 32768 (originally 32768) Batches: 2 (originally 1) Memory Usage: 1842kB
24. 19.289 19.289 ↓ 1.6 33,804 1

Index Scan using idx_cpedido_cpe_estado on cpedido cpe (cost=0.29..2,616.95 rows=21,405 width=45) (actual time=0.023..19.289 rows=33,804 loops=1)

  • Index Cond: (cpe_estado = ANY ('{3,4}'::integer[]))
  • Filter: (cti_id = 65)
  • Rows Removed by Filter: 6
25. 1.161 2.647 ↑ 1.0 6,404 1

Hash (cost=182.40..182.40 rows=6,540 width=16) (actual time=2.647..2.647 rows=6,404 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 347kB
26. 1.486 1.486 ↑ 1.0 6,404 1

Seq Scan on cliente cli (cost=0.00..182.40 rows=6,540 width=16) (actual time=0.014..1.486 rows=6,404 loops=1)

27. 1.426 2.642 ↑ 1.0 6,163 1

Hash (cost=150.21..150.21 rows=6,221 width=31) (actual time=2.642..2.642 rows=6,163 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 463kB
28. 1.216 1.216 ↑ 1.0 6,163 1

Seq Scan on entidad ent (cost=0.00..150.21 rows=6,221 width=31) (actual time=0.010..1.216 rows=6,163 loops=1)

29. 0.014 0.035 ↓ 1.0 81 1

Hash (cost=1.78..1.78 rows=78 width=8) (actual time=0.035..0.035 rows=81 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
30. 0.021 0.021 ↓ 1.0 81 1

Seq Scan on empleado emp (cost=0.00..1.78 rows=78 width=8) (actual time=0.011..0.021 rows=81 loops=1)

31. 1.378 2.448 ↑ 1.0 6,163 1

Hash (cost=150.21..150.21 rows=6,221 width=31) (actual time=2.447..2.448 rows=6,163 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 463kB
32. 1.070 1.070 ↑ 1.0 6,163 1

Seq Scan on entidad ent2 (cost=0.00..150.21 rows=6,221 width=31) (actual time=0.005..1.070 rows=6,163 loops=1)

33. 1.390 3.906 ↓ 1.0 5,053 1

Hash (cost=302.49..302.49 rows=5,049 width=84) (actual time=3.906..3.906 rows=5,053 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 630kB
34. 2.516 2.516 ↓ 1.0 5,053 1

Seq Scan on producto pro (cost=0.00..302.49 rows=5,049 width=84) (actual time=0.011..2.516 rows=5,053 loops=1)

35. 0.007 0.021 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=422) (actual time=0.021..0.021 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.014 0.014 ↑ 1.0 16 1

Seq Scan on bodega bod (cost=0.00..1.16 rows=16 width=422) (actual time=0.012..0.014 rows=16 loops=1)

37. 1.053 4.417 ↓ 1.0 5,053 1

Hash (cost=298.30..298.30 rows=5,051 width=16) (actual time=4.417..4.417 rows=5,053 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 301kB
38. 2.203 3.364 ↓ 1.0 5,053 1

Hash Left Join (cost=38.34..298.30 rows=5,051 width=16) (actual time=0.473..3.364 rows=5,053 loops=1)

  • Hash Cond: (pro1.cla1_id = cla11.cla1_id)
39. 0.701 0.701 ↓ 1.0 5,053 1

Seq Scan on producto1 pro1 (cost=0.00..190.51 rows=5,051 width=16) (actual time=0.007..0.701 rows=5,053 loops=1)

40. 0.081 0.460 ↑ 1.0 443 1

Hash (cost=32.80..32.80 rows=443 width=8) (actual time=0.460..0.460 rows=443 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
41. 0.114 0.379 ↑ 1.0 443 1

Hash Right Join (cost=14.97..32.80 rows=443 width=8) (actual time=0.154..0.379 rows=443 loops=1)

  • Hash Cond: (jef.cla1_id = cla11.cla1_id)
42. 0.126 0.126 ↑ 1.0 428 1

Seq Scan on jefe_linea jef (cost=0.00..16.70 rows=428 width=8) (actual time=0.010..0.126 rows=428 loops=1)

  • Filter: (jel_tipo = 1)
  • Rows Removed by Filter: 428
43. 0.068 0.139 ↑ 1.0 443 1

Hash (cost=9.43..9.43 rows=443 width=4) (actual time=0.139..0.139 rows=443 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
44. 0.071 0.071 ↑ 1.0 443 1

Seq Scan on clasificacion1 cla11 (cost=0.00..9.43 rows=443 width=4) (actual time=0.008..0.071 rows=443 loops=1)

45. 0.003 0.014 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=8) (actual time=0.013..0.014 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.011 0.011 ↑ 1.0 5 1

Seq Scan on unidad uni (cost=0.00..1.05 rows=5 width=8) (actual time=0.010..0.011 rows=5 loops=1)

47. 0.115 0.201 ↑ 1.0 443 1

Hash (cost=9.43..9.43 rows=443 width=21) (actual time=0.201..0.201 rows=443 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
48. 0.086 0.086 ↑ 1.0 443 1

Seq Scan on clasificacion1 cla1 (cost=0.00..9.43 rows=443 width=21) (actual time=0.006..0.086 rows=443 loops=1)

49. 0.005 0.016 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=422) (actual time=0.016..0.016 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
50. 0.011 0.011 ↑ 1.0 16 1

Seq Scan on clasificacion2 cla2 (cost=0.00..1.16 rows=16 width=422) (actual time=0.009..0.011 rows=16 loops=1)

51. 0.352 0.651 ↑ 1.0 1,698 1

Hash (cost=37.98..37.98 rows=1,698 width=20) (actual time=0.651..0.651 rows=1,698 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 105kB
52. 0.299 0.299 ↑ 1.0 1,698 1

Seq Scan on ubicacion ubi (cost=0.00..37.98 rows=1,698 width=20) (actual time=0.006..0.299 rows=1,698 loops=1)

53. 0.017 0.037 ↓ 1.0 81 1

Hash (cost=1.78..1.78 rows=78 width=10) (actual time=0.036..0.037 rows=81 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
54. 0.020 0.020 ↓ 1.0 81 1

Seq Scan on empleado emp2 (cost=0.00..1.78 rows=78 width=10) (actual time=0.009..0.020 rows=81 loops=1)

55. 0.770 1.567 ↑ 1.0 4,004 1

Hash (cost=74.04..74.04 rows=4,004 width=8) (actual time=1.567..1.567 rows=4,004 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 189kB
56. 0.797 0.797 ↑ 1.0 4,004 1

Seq Scan on producto_clasabcfms1 abc1 (cost=0.00..74.04 rows=4,004 width=8) (actual time=0.008..0.797 rows=4,004 loops=1)

57. 0.766 1.550 ↑ 1.0 3,923 1

Hash (cost=71.23..71.23 rows=3,923 width=8) (actual time=1.550..1.550 rows=3,923 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 186kB
58. 0.784 0.784 ↑ 1.0 3,923 1

Seq Scan on producto_clasabcfms2 abc2 (cost=0.00..71.23 rows=3,923 width=8) (actual time=0.011..0.784 rows=3,923 loops=1)

59. 0.784 1.705 ↑ 1.0 3,968 1

Hash (cost=78.68..78.68 rows=3,968 width=24) (actual time=1.705..1.705 rows=3,968 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 237kB
60. 0.921 0.921 ↑ 1.0 3,968 1

Seq Scan on producto_importaciones pim (cost=0.00..78.68 rows=3,968 width=24) (actual time=0.012..0.921 rows=3,968 loops=1)

61. 0.822 2.030 ↑ 2.1 4,308 1

Hash (cost=447.01..447.01 rows=9,101 width=8) (actual time=2.030..2.030 rows=4,308 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 309kB
62. 1.208 1.208 ↑ 2.1 4,308 1

Seq Scan on buffer buf (cost=0.00..447.01 rows=9,101 width=8) (actual time=0.008..1.208 rows=4,308 loops=1)

63. 0.024 0.057 ↑ 1.0 62 1

Hash (cost=1.62..1.62 rows=62 width=10) (actual time=0.057..0.057 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
64. 0.033 0.033 ↑ 1.0 62 1

Seq Scan on marca mar (cost=0.00..1.62 rows=62 width=10) (actual time=0.018..0.033 rows=62 loops=1)

65. 0.442 0.822 ↑ 1.0 1,698 1

Hash (cost=37.98..37.98 rows=1,698 width=20) (actual time=0.822..0.822 rows=1,698 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 105kB
66. 0.380 0.380 ↑ 1.0 1,698 1

Seq Scan on ubicacion ubi2 (cost=0.00..37.98 rows=1,698 width=20) (actual time=0.011..0.380 rows=1,698 loops=1)

67. 15.578 24.640 ↓ 1.0 50,530 1

Hash (cost=845.10..845.10 rows=50,510 width=14) (actual time=24.640..24.640 rows=50,530 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 1689kB
68. 9.062 9.062 ↓ 1.0 50,530 1

Seq Scan on dlistapre dlp (cost=0.00..845.10 rows=50,510 width=14) (actual time=0.013..9.062 rows=50,530 loops=1)

69. 3.365 17.009 ↓ 22.9 4,457 1

Hash (cost=40,134.52..40,134.52 rows=195 width=79) (actual time=17.009..17.009 rows=4,457 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 604kB
70. 11.865 13.644 ↓ 22.9 4,457 1

Bitmap Heap Scan on saldoinv (cost=10,895.29..40,134.52 rows=195 width=79) (actual time=4.633..13.644 rows=4,457 loops=1)

  • Recheck Cond: (bod_id = 1)
  • Filter: ((sal_periodo)::double precision = date_part('year'::text, (('now'::cstring)::date)::timestamp without time zone))
  • Rows Removed by Filter: 7121
  • Heap Blocks: exact=1074
71. 1.779 1.779 ↑ 1.6 24,108 1

Bitmap Index Scan on idx_saldoinv_bod (cost=0.00..10,895.24 rows=39,070 width=0) (actual time=1.779..1.779 rows=24,108 loops=1)

  • Index Cond: (bod_id = 1)
Planning time : 13.002 ms