explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HD23

Settings
# exclusive inclusive rows x rows loops node
1. 0.114 4,845.097 ↑ 190.5 70 1

HashAggregate (cost=166,557.10..166,690.45 rows=13,335 width=8) (actual time=4,845.021..4,845.097 rows=70 loops=1)

  • Group Key: vru.pro_id, (1)
2. 0.015 4,844.983 ↑ 190.5 70 1

Append (cost=7,229.40..166,490.42 rows=13,335 width=8) (actual time=3,571.281..4,844.983 rows=70 loops=1)

3. 0.000 42.795 ↓ 0.0 0 1

Subquery Scan on vru (cost=7,229.40..7,229.42 rows=1 width=8) (actual time=42.795..42.795 rows=0 loops=1)

4. 0.001 42.795 ↓ 0.0 0 1

Unique (cost=7,229.40..7,229.41 rows=1 width=16) (actual time=42.795..42.795 rows=0 loops=1)

5. 0.003 42.794 ↓ 0.0 0 1

Sort (cost=7,229.40..7,229.41 rows=1 width=16) (actual time=42.794..42.794 rows=0 loops=1)

  • Sort Key: dfa.pro_id, (CASE WHEN (cla11.cla1_id = 419) THEN cla2.cla2_id ELSE cla11.cla1_id END), t1.ubi_id
  • Sort Method: quicksort Memory: 25kB
6. 1.048 42.791 ↓ 0.0 0 1

Nested Loop (cost=612.87..7,229.39 rows=1 width=16) (actual time=42.791..42.791 rows=0 loops=1)

  • Join Filter: (dfa.pro_id = pro_1.pro_id)
7. 1.574 41.743 ↓ 109.2 3,058 1

Nested Loop (cost=546.59..7,109.93 rows=28 width=8) (actual time=1.842..41.743 rows=3,058 loops=1)

8. 32.453 34.053 ↓ 109.2 3,058 1

Bitmap Heap Scan on saldoinv sal (cost=546.31..7,057.53 rows=28 width=4) (actual time=1.833..34.053 rows=3,058 loops=1)

  • Recheck Cond: (bod_id = 1)
  • Filter: (((sal_periodo)::double precision = date_part('year'::text, (CURRENT_DATE)::timestamp without time zone)) AND (((((((((((((((((((((((((sal_sinicial - sal_cre1) - sal_cre2) - sal_cre3) - sal_cre4) - sal_cre5) - sal_cre6) - sal_cre7) - sal_cre8) - sal_cre9) - sal_cre10) - sal_cre11) - sal_cre12) + sal_deb1) + (+ sal_deb2)) + sal_deb3) + sal_deb4) + sal_deb5) + sal_deb6) + sal_deb7) + sal_deb8) + sal_deb9) + sal_deb10) + sal_deb11) + sal_deb12) > '0'::numeric))
  • Rows Removed by Filter: 13818
  • Heap Blocks: exact=1465
9. 1.600 1.600 ↓ 1.0 16,876 1

Bitmap Index Scan on idx_saldoinv_bod_id_pro_id (cost=0.00..546.30 rows=16,758 width=0) (actual time=1.600..1.600 rows=16,876 loops=1)

  • Index Cond: (bod_id = 1)
10. 6.116 6.116 ↑ 1.0 1 3,058

Index Only Scan using producto_pkey on producto pro_1 (cost=0.28..1.87 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=3,058)

  • Index Cond: (pro_id = sal.pro_id)
  • Heap Fetches: 2760
11. 0.000 0.000 ↓ 0.0 0 3,058

Materialize (cost=66.28..109.86 rows=23 width=16) (actual time=0.000..0.000 rows=0 loops=3,058)

12. 0.001 0.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=66.28..109.75 rows=23 width=16) (actual time=0.013..0.013 rows=0 loops=1)

13. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=65.03..77.26 rows=23 width=12) (actual time=0.012..0.012 rows=0 loops=1)

14. 0.000 0.012 ↓ 0.0 0 1

Subquery Scan on t1 (cost=64.61..64.65 rows=1 width=12) (actual time=0.012..0.012 rows=0 loops=1)

  • Filter: (t1.veces_facturado <= 2)
15. 0.001 0.012 ↓ 0.0 0 1

WindowAgg (cost=64.61..64.64 rows=1 width=28) (actual time=0.012..0.012 rows=0 loops=1)

16. 0.003 0.011 ↓ 0.0 0 1

Sort (cost=64.61..64.62 rows=1 width=16) (actual time=0.011..0.011 rows=0 loops=1)

  • Sort Key: (date(cfa.cfa_fecha)) DESC
  • Sort Method: quicksort Memory: 25kB
17. 0.000 0.008 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..64.60 rows=1 width=16) (actual time=0.008..0.008 rows=0 loops=1)

18. 0.001 0.008 ↓ 0.0 0 1

Nested Loop (cost=0.71..62.34 rows=1 width=16) (actual time=0.007..0.008 rows=0 loops=1)

19. 0.007 0.007 ↓ 0.0 0 1

Index Scan using idx_cfactura_cfa_transacc_cli_id on cfactura cfa (cost=0.29..17.00 rows=17 width=32) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((cfa_transacc = 3) AND (cli_id = 36))
20. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ccomproba_ccm_numero_pve_id on ccomproba ccm (cost=0.42..2.66 rows=1 width=16) (never executed)

  • Index Cond: ((ccm_numero = cfa.cfa_numero) AND (pve_id = cfa.pve_id))
  • Filter: ((ccm_estado = 2) AND (cfa.cfa_periodo = ccm_periodo) AND (cfa.cti_id = cti_id) AND (date(ccm_fecha) >= (CURRENT_DATE - '3 mons'::interval)))
21. 0.000 0.000 ↓ 0.0 0

Index Scan using cliente_pkey on cliente cli (cost=0.28..2.24 rows=1 width=8) (never executed)

  • Index Cond: ((cfa.cli_id = cli_id) AND (cli_id = 36))
22. 0.000 0.000 ↓ 0.0 0

Index Scan using dfactura_llave_cabecera on dfactura dfa (cost=0.42..12.39 rows=23 width=8) (never executed)

  • Index Cond: (cfa_id = t1.cfa_id)
23. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.24..1.40 rows=1 width=8) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.11..1.24 rows=1 width=12) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.84..0.93 rows=1 width=12) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.56..0.64 rows=1 width=12) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Index Only Scan using producto_pkey on producto pro (cost=0.28..0.30 rows=1 width=4) (never executed)

  • Index Cond: (pro_id = dfa.pro_id)
  • Heap Fetches: 0
28. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_producto1_producto on producto1 p1 (cost=0.28..0.33 rows=1 width=12) (never executed)

  • Index Cond: (pro_id = pro.pro_id)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using clasificacion1_pk on clasificacion1 cla1_1 (cost=0.27..0.29 rows=1 width=8) (never executed)

  • Index Cond: (cla1_id = p1.cla1_id)
30. 0.000 0.000 ↓ 0.0 0

Index Only Scan using clasificacion1_pk on clasificacion1 cla11 (cost=0.27..0.31 rows=1 width=4) (never executed)

  • Index Cond: (cla1_id = cla1_1.cla1_reporta)
  • Heap Fetches: 0
31. 0.000 0.000 ↓ 0.0 0

Index Only Scan using clasificacion2_pk on clasificacion2 cla2 (cost=0.14..0.15 rows=1 width=4) (never executed)

  • Index Cond: (cla2_id = p1.cla2_id)
  • Heap Fetches: 0
32. 0.855 3,587.655 ↓ 60.0 60 1

Subquery Scan on vrp (cost=4,788.65..4,788.75 rows=1 width=8) (actual time=3,528.484..3,587.655 rows=60 loops=1)

  • Filter: (vrp.ubi_id = 788)
  • Rows Removed by Filter: 5573
33. 8.604 3,586.800 ↓ 5,633.0 5,633 1

Subquery Scan on tf (cost=4,788.65..4,788.73 rows=1 width=36) (actual time=3,504.668..3,586.800 rows=5,633 loops=1)

  • Filter: (tf.orden < 11)
  • Rows Removed by Filter: 48771
34. 37.386 3,578.196 ↓ 27,202.0 54,404 1

WindowAgg (cost=4,788.65..4,788.71 rows=2 width=52) (actual time=3,504.665..3,578.196 rows=54,404 loops=1)

35. 13.653 3,540.810 ↓ 27,202.0 54,404 1

Subquery Scan on t3 (cost=4,788.65..4,788.67 rows=2 width=12) (actual time=3,504.658..3,540.810 rows=54,404 loops=1)

36. 114.954 3,527.157 ↓ 27,202.0 54,404 1

Sort (cost=4,788.65..4,788.65 rows=2 width=44) (actual time=3,504.655..3,527.157 rows=54,404 loops=1)

  • Sort Key: ubi.ubi3_id, (CASE WHEN (cla11_1.cla1_id = 419) THEN cla2_1.cla2_id ELSE cla11_1.cla1_id END), (sum((CASE WHEN (COALESCE(pr.pro_ultcostoprome, '0'::numeric) > '0'::numeric) THEN (sum(dfa_1.dfac_cantidad) * pr.pro_ultcostoprome) ELSE (sum(dfa_1.dfac_cantidad) * pr.pro_ultcostocompra) END))) DESC
  • Sort Method: external merge Disk: 1552kB
37. 53.146 3,412.203 ↓ 27,202.0 54,404 1

GroupAggregate (cost=4,788.58..4,788.64 rows=2 width=44) (actual time=3,347.380..3,412.203 rows=54,404 loops=1)

  • Group Key: pro_2.pro_id, ubi.ubi3_id, (CASE WHEN (cla11_1.cla1_id = 419) THEN cla2_1.cla2_id ELSE cla11_1.cla1_id END)
38. 61.701 3,359.057 ↓ 27,202.0 54,404 1

Sort (cost=4,788.58..4,788.59 rows=2 width=44) (actual time=3,347.370..3,359.057 rows=54,404 loops=1)

  • Sort Key: pro_2.pro_id, ubi.ubi3_id, (CASE WHEN (cla11_1.cla1_id = 419) THEN cla2_1.cla2_id ELSE cla11_1.cla1_id END)
  • Sort Method: external merge Disk: 1552kB
39. 58.950 3,297.356 ↓ 27,202.0 54,404 1

Nested Loop Left Join (cost=4,782.39..4,788.57 rows=2 width=44) (actual time=2,236.530..3,297.356 rows=54,404 loops=1)

40. 32.355 3,184.002 ↓ 27,202.0 54,404 1

Nested Loop Left Join (cost=4,782.25..4,788.26 rows=2 width=48) (actual time=2,236.521..3,184.002 rows=54,404 loops=1)

41. 36.924 3,042.839 ↓ 27,202.0 54,404 1

Nested Loop Left Join (cost=4,781.98..4,787.64 rows=2 width=48) (actual time=2,236.515..3,042.839 rows=54,404 loops=1)

42. 22.467 2,897.107 ↓ 27,202.0 54,404 1

Nested Loop Left Join (cost=4,781.71..4,787.05 rows=2 width=48) (actual time=2,236.503..2,897.107 rows=54,404 loops=1)

43. 54.068 2,711.428 ↓ 27,202.0 54,404 1

Nested Loop (cost=4,781.43..4,786.37 rows=2 width=40) (actual time=2,236.490..2,711.428 rows=54,404 loops=1)

44. 166.471 2,548.552 ↓ 27,202.0 54,404 1

Finalize GroupAggregate (cost=4,781.14..4,781.35 rows=2 width=52) (actual time=2,236.467..2,548.552 rows=54,404 loops=1)

  • Group Key: ubi.ubi3_id, dfa_1.pro_id, pr.pro_ultcostoprome, pr.pro_ultcostocompra
45. 87.660 2,382.081 ↓ 68,356.0 68,356 1

Gather Merge (cost=4,781.14..4,781.29 rows=1 width=52) (actual time=2,236.447..2,382.081 rows=68,356 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
46. 69.937 2,294.421 ↓ 34,178.0 34,178 2 / 2

Partial GroupAggregate (cost=3,781.13..3,781.16 rows=1 width=52) (actual time=2,204.570..2,294.421 rows=34,178 loops=2)

  • Group Key: ubi.ubi3_id, dfa_1.pro_id, pr.pro_ultcostoprome, pr.pro_ultcostocompra
47. 114.211 2,224.484 ↓ 55,878.0 55,878 2 / 2

Sort (cost=3,781.13..3,781.14 rows=1 width=24) (actual time=2,204.551..2,224.484 rows=55,878 loops=2)

  • Sort Key: ubi.ubi3_id, dfa_1.pro_id, pr.pro_ultcostoprome, pr.pro_ultcostocompra
  • Sort Method: external merge Disk: 2376kB
  • Worker 0: Sort Method: external merge Disk: 1568kB
48. 55.665 2,110.273 ↓ 55,878.0 55,878 2 / 2

Nested Loop Left Join (cost=2.38..3,781.12 rows=1 width=24) (actual time=16.095..2,110.273 rows=55,878 loops=2)

49. 72.185 1,886.974 ↓ 55,878.0 55,878 2 / 2

Nested Loop Left Join (cost=2.10..3,780.81 rows=1 width=24) (actual time=16.071..1,886.974 rows=55,878 loops=2)

50. 54.866 1,647.155 ↓ 55,878.0 55,878 2 / 2

Nested Loop Left Join (cost=1.82..3,779.76 rows=1 width=24) (actual time=16.050..1,647.155 rows=55,878 loops=2)

51. 58.846 1,424.655 ↓ 55,878.0 55,878 2 / 2

Nested Loop (cost=1.54..3,779.46 rows=1 width=12) (actual time=16.043..1,424.655 rows=55,878 loops=2)

  • Join Filter: (sal_1.pro_id = pro_3.pro_id)
52. 50.999 1,198.175 ↓ 27,939.0 55,878 2 / 2

Nested Loop (cost=1.26..3,778.83 rows=2 width=16) (actual time=16.009..1,198.175 rows=55,878 loops=2)

53. 29.916 152.912 ↓ 230.2 62,142 2 / 2

Nested Loop (cost=0.84..3,581.45 rows=270 width=12) (actual time=15.963..152.912 rows=62,142 loops=2)

54. 7.599 60.868 ↓ 121.3 3,883 2 / 2

Nested Loop (cost=0.42..3,263.60 rows=32 width=8) (actual time=15.937..60.868 rows=3,883 loops=2)

55. 25.923 25.923 ↓ 30.3 3,906 2 / 2

Parallel Seq Scan on cfactura cfa_1 (cost=0.00..2,948.00 rows=129 width=24) (actual time=15.908..25.923 rows=3,906 loops=2)

  • Filter: ((cfa_transacc = 3) AND (date(cfa_fecha) <= CURRENT_DATE) AND (date(cfa_fecha) >= date((CURRENT_DATE - '6 mons'::interval))))
  • Rows Removed by Filter: 24872
56. 27.346 27.346 ↑ 1.0 1 7,813 / 2

Index Scan using idx_ccomproba_ccm_numero_pve_id on ccomproba ccm_1 (cost=0.42..2.44 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=7,813)

  • Index Cond: ((ccm_numero = cfa_1.cfa_numero) AND (pve_id = cfa_1.pve_id))
  • Filter: ((ccm_estado = 2) AND (cfa_1.cfa_periodo = ccm_periodo) AND (cfa_1.cti_id = cti_id))
  • Rows Removed by Filter: 0
57. 62.128 62.128 ↑ 1.4 16 7,766 / 2

Index Scan using dfactura_llave_cabecera on dfactura dfa_1 (cost=0.42..9.70 rows=23 width=12) (actual time=0.008..0.016 rows=16 loops=7,766)

  • Index Cond: (cfa_id = cfa_1.cfa_id)
58. 994.264 994.264 ↑ 1.0 1 124,283 / 2

Index Scan using idx_saldoinv_bod_id_pro_id on saldoinv sal_1 (cost=0.41..0.72 rows=1 width=4) (actual time=0.011..0.016 rows=1 loops=124,283)

  • Index Cond: ((bod_id = 1) AND (pro_id = dfa_1.pro_id))
  • Filter: (((sal_periodo)::double precision = date_part('year'::text, (CURRENT_DATE)::timestamp without time zone)) AND (((((((((((((((((((((((((sal_sinicial - sal_cre1) - sal_cre2) - sal_cre3) - sal_cre4) - sal_cre5) - sal_cre6) - sal_cre7) - sal_cre8) - sal_cre9) - sal_cre10) - sal_cre11) - sal_cre12) + sal_deb1) + (+ sal_deb2)) + sal_deb3) + sal_deb4) + sal_deb5) + sal_deb6) + sal_deb7) + sal_deb8) + sal_deb9) + sal_deb10) + sal_deb11) + sal_deb12) > '0'::numeric))
  • Rows Removed by Filter: 3
59. 167.634 167.634 ↑ 1.0 1 111,756 / 2

Index Only Scan using producto_pkey on producto pro_3 (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=111,756)

  • Index Cond: (pro_id = dfa_1.pro_id)
  • Heap Fetches: 104502
60. 167.634 167.634 ↑ 1.0 1 111,756 / 2

Index Scan using producto_pkey on producto pr (cost=0.28..0.30 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=111,756)

  • Index Cond: (pro_id = dfa_1.pro_id)
61. 167.634 167.634 ↑ 1.0 1 111,756 / 2

Index Scan using cliente_pkey on cliente cli_1 (cost=0.28..1.05 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=111,756)

  • Index Cond: (cli_id = cfa_1.cli_id)
62. 167.634 167.634 ↑ 1.0 1 111,756 / 2

Index Scan using idx_ubicacion_id_final on v_ubicacion ubi (cost=0.28..0.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=111,756)

  • Index Cond: (id_final = cli_1.ubi_id)
63. 108.808 108.808 ↑ 1.0 1 54,404

Index Only Scan using producto_pkey on producto pro_2 (cost=0.28..2.50 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=54,404)

  • Index Cond: (pro_id = dfa_1.pro_id)
  • Heap Fetches: 50928
64. 163.212 163.212 ↑ 1.0 1 54,404

Index Scan using idx_producto1_producto on producto1 p1_1 (cost=0.28..0.33 rows=1 width=12) (actual time=0.002..0.003 rows=1 loops=54,404)

  • Index Cond: (pro_id = pro_2.pro_id)
65. 108.808 108.808 ↑ 1.0 1 54,404

Index Scan using clasificacion1_pk on clasificacion1 cla1 (cost=0.27..0.29 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=54,404)

  • Index Cond: (cla1_id = p1_1.cla1_id)
66. 108.808 108.808 ↑ 1.0 1 54,404

Index Only Scan using clasificacion1_pk on clasificacion1 cla11_1 (cost=0.27..0.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=54,404)

  • Index Cond: (cla1_id = cla1.cla1_reporta)
  • Heap Fetches: 54404
67. 54.404 54.404 ↑ 1.0 1 54,404

Index Only Scan using clasificacion2_pk on clasificacion2 cla2_1 (cost=0.14..0.15 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=54,404)

  • Index Cond: (cla2_id = p1_1.cla2_id)
  • Heap Fetches: 54404
68. 0.332 1,214.518 ↑ 1,333.3 10 1

Subquery Scan on t6 (cost=152,572.23..154,272.23 rows=13,333 width=8) (actual time=1,211.986..1,214.518 rows=10 loops=1)

  • Filter: ((t6.cao_orden <= 10) AND (t6.cao_orden < 11))
  • Rows Removed by Filter: 2399
69. 1.419 1,214.186 ↑ 16.6 2,409 1

WindowAgg (cost=152,572.23..153,672.23 rows=40,000 width=24) (actual time=1,211.983..1,214.186 rows=2,409 loops=1)

70. 0.536 1,212.767 ↑ 16.6 2,409 1

Subquery Scan on t5 (cost=152,572.23..153,072.23 rows=40,000 width=8) (actual time=1,211.978..1,212.767 rows=2,409 loops=1)

71. 11.111 1,212.231 ↑ 16.6 2,409 1

Sort (cost=152,572.23..152,672.23 rows=40,000 width=103) (actual time=1,211.975..1,212.231 rows=2,409 loops=1)

  • Sort Key: (sum(mw.unidades)) DESC, pro_4.pro_nombre
  • Sort Method: quicksort Memory: 437kB
72. 1.364 1,201.120 ↑ 16.6 2,409 1

Hash Left Join (cost=136,829.69..148,233.44 rows=40,000 width=103) (actual time=1,181.525..1,201.120 rows=2,409 loops=1)

  • Hash Cond: (pmh.prod1 = pro1.prod1_id)
73. 3.803 1,177.553 ↑ 16.6 2,409 1

Finalize GroupAggregate (cost=135,461.44..145,915.19 rows=40,000 width=40) (actual time=1,159.308..1,177.553 rows=2,409 loops=1)

  • Group Key: mw.ubi_id, pmh.prod1
74. 69.616 1,173.750 ↑ 10.5 3,800 1

Gather Merge (cost=135,461.44..145,015.19 rows=40,000 width=40) (actual time=1,159.299..1,173.750 rows=3,800 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
75. 6.404 1,104.134 ↑ 21.1 1,900 2 / 2

Partial GroupAggregate (cost=134,461.43..139,515.18 rows=40,000 width=40) (actual time=1,096.715..1,104.134 rows=1,900 loops=2)

  • Group Key: mw.ubi_id, pmh.prod1
76. 4.156 1,097.730 ↑ 58.8 7,742 2 / 2

Sort (cost=134,461.43..135,599.86 rows=455,375 width=16) (actual time=1,096.700..1,097.730 rows=7,742 loops=2)

  • Sort Key: pmh.prod1
  • Sort Method: quicksort Memory: 124kB
  • Worker 0: Sort Method: quicksort Memory: 1035kB
77. 4.455 1,093.574 ↑ 58.8 7,742 2 / 2

Merge Join (cost=80,183.77..87,104.50 rows=455,375 width=16) (actual time=1,086.750..1,093.574 rows=7,742 loops=2)

  • Merge Cond: (pmh.mdl_id = mw.mdl_id)
78. 5.852 1,078.467 ↑ 1.3 13,533 2 / 2

Sort (cost=74,647.25..74,692.35 rows=18,038 width=8) (actual time=1,076.886..1,078.467 rows=13,533 loops=2)

  • Sort Key: pmh.mdl_id
  • Sort Method: quicksort Memory: 216kB
  • Worker 0: Sort Method: quicksort Memory: 1918kB
79. 1.807 1,072.615 ↑ 1.3 13,533 2 / 2

Parallel Append (cost=36,165.01..73,372.08 rows=18,038 width=8) (actual time=1,059.576..1,072.615 rows=13,533 loops=2)

80. 4.514 553.052 ↑ 1.0 24,516 1 / 2

Hash Join (cost=36,165.01..36,620.99 rows=25,261 width=8) (actual time=1,093.363..1,106.104 rows=24,516 loops=1)

  • Hash Cond: (pmh.mdl_id = tmp_marketwatch.mdl_id)
81. 1.895 1.895 ↑ 1.0 24,788 1 / 2

Seq Scan on productos_modelos_hermanos pmh (cost=0.00..389.61 rows=25,261 width=8) (actual time=0.019..3.790 rows=24,788 loops=1)

82. 1.345 546.643 ↓ 2.2 11,706 1 / 2

Hash (cost=36,098.64..36,098.64 rows=5,310 width=4) (actual time=1,093.285..1,093.285 rows=11,706 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 540kB
83. 371.759 545.298 ↓ 2.2 11,706 1 / 2

HashAggregate (cost=35,992.44..36,045.54 rows=5,310 width=4) (actual time=1,088.101..1,090.595 rows=11,706 loops=1)

  • Group Key: tmp_marketwatch.mdl_id
84. 173.539 173.539 ↑ 1.0 878,755 1 / 2

Seq Scan on tmp_marketwatch (cost=0.00..33,795.55 rows=878,755 width=4) (actual time=0.014..347.078 rows=878,755 loops=1)

85. 4.474 517.756 ↑ 2.1 2,550 1 / 2

Hash Join (cost=36,165.01..36,354.25 rows=5,404 width=8) (actual time=1,025.788..1,035.512 rows=2,550 loops=1)

  • Hash Cond: (pro1_1.mdl_id = tmp_marketwatch_1.mdl_id)
86. 0.398 0.398 ↓ 1.0 5,407 1 / 2

Seq Scan on producto1 pro1_1 (cost=0.00..175.04 rows=5,404 width=8) (actual time=0.007..0.796 rows=5,407 loops=1)

87. 1.331 512.884 ↓ 2.2 11,706 1 / 2

Hash (cost=36,098.64..36,098.64 rows=5,310 width=4) (actual time=1,025.768..1,025.768 rows=11,706 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 540kB
88. 384.624 511.553 ↓ 2.2 11,706 1 / 2

HashAggregate (cost=35,992.44..36,045.54 rows=5,310 width=4) (actual time=1,013.235..1,023.106 rows=11,706 loops=1)

  • Group Key: tmp_marketwatch_1.mdl_id
89. 126.929 126.929 ↑ 1.0 878,755 1 / 2

Seq Scan on tmp_marketwatch tmp_marketwatch_1 (cost=0.00..33,795.55 rows=878,755 width=4) (actual time=0.005..253.858 rows=878,755 loops=1)

90. 1.241 10.652 ↓ 1.7 8,729 2 / 2

Sort (cost=5,536.52..5,549.15 rows=5,049 width=16) (actual time=9.837..10.652 rows=8,729 loops=2)

  • Sort Key: mw.mdl_id
  • Sort Method: quicksort Memory: 142kB
  • Worker 0: Sort Method: quicksort Memory: 142kB
91. 0.206 9.411 ↑ 4.2 1,200 2 / 2

Subquery Scan on mw (cost=5,124.98..5,225.96 rows=5,049 width=16) (actual time=8.884..9.411 rows=1,200 loops=2)

92. 3.480 9.205 ↑ 4.2 1,200 2 / 2

HashAggregate (cost=5,124.98..5,175.47 rows=5,049 width=16) (actual time=8.883..9.205 rows=1,200 loops=2)

  • Group Key: tmp_marketwatch_2.ubi_id, tmp_marketwatch_2.mdl_id
93. 5.342 5.725 ↑ 1.0 4,977 2 / 2

Bitmap Heap Scan on tmp_marketwatch tmp_marketwatch_2 (cost=57.11..5,086.10 rows=5,185 width=12) (actual time=0.462..5.725 rows=4,977 loops=2)

  • Recheck Cond: (ubi_id = 788)
  • Heap Blocks: exact=638
94. 0.383 0.383 ↑ 1.0 4,977 2 / 2

Bitmap Index Scan on idx_tmp_marketwatch_ubi_id_mdl_id (cost=0.00..55.81 rows=5,185 width=0) (actual time=0.382..0.383 rows=4,977 loops=2)

  • Index Cond: (ubi_id = 788)
95. 2.090 22.203 ↓ 1.0 5,407 1

Hash (cost=1,300.70..1,300.70 rows=5,404 width=67) (actual time=22.203..22.203 rows=5,407 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 591kB
96. 2.565 20.113 ↓ 1.0 5,407 1

Hash Right Join (cost=1,022.96..1,300.70 rows=5,404 width=67) (actual time=11.649..20.113 rows=5,407 loops=1)

  • Hash Cond: (pro_4.pro_id = pro1.pro_id)
97. 2.423 15.245 ↓ 1.0 5,407 1

Hash Right Join (cost=780.37..983.81 rows=5,404 width=63) (actual time=9.336..15.245 rows=5,407 loops=1)

  • Hash Cond: (pro_1_1.pro_id = pro_4.pro_id)
98. 2.631 9.360 ↓ 1.0 5,407 1

Hash Right Join (cost=383.78..573.02 rows=5,404 width=4) (actual time=5.842..9.360 rows=5,407 loops=1)

  • Hash Cond: (p1_2.pro_id = pro_1_1.pro_id)
99. 0.925 0.925 ↓ 1.0 5,407 1

Seq Scan on producto1 p1_2 (cost=0.00..175.04 rows=5,404 width=12) (actual time=0.006..0.925 rows=5,407 loops=1)

100. 1.184 5.804 ↓ 1.0 5,407 1

Hash (cost=316.23..316.23 rows=5,404 width=4) (actual time=5.803..5.804 rows=5,407 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 255kB
101. 4.620 4.620 ↓ 1.0 5,407 1

Index Only Scan using producto_pkey on producto pro_1_1 (cost=0.28..316.23 rows=5,404 width=4) (actual time=0.017..4.620 rows=5,407 loops=1)

  • Heap Fetches: 4680
102. 1.800 3.462 ↓ 1.0 5,407 1

Hash (cost=329.04..329.04 rows=5,404 width=63) (actual time=3.462..3.462 rows=5,407 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 570kB
103. 1.662 1.662 ↓ 1.0 5,407 1

Seq Scan on producto pro_4 (cost=0.00..329.04 rows=5,404 width=63) (actual time=0.006..1.662 rows=5,407 loops=1)

104. 1.143 2.303 ↓ 1.0 5,407 1

Hash (cost=175.04..175.04 rows=5,404 width=8) (actual time=2.303..2.303 rows=5,407 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 276kB
105. 1.160 1.160 ↓ 1.0 5,407 1

Seq Scan on producto1 pro1 (cost=0.00..175.04 rows=5,404 width=8) (actual time=0.010..1.160 rows=5,407 loops=1)

Planning time : 29.989 ms
Execution time : 4,848.464 ms