explain.depesz.com

PostgreSQL's explain analyze made readable

Result: du6q

Settings
# exclusive inclusive rows x rows loops node
1. 1,106.106 7,412.562 ↓ 39.9 9,215 1

Nested Loop Left Join (cost=1,041,591.55..1,043,006.95 rows=231 width=1,627) (actual time=6,117.307..7,412.562 rows=9,215 loops=1)

2.          

CTE dividends

3. 42.570 1,075.465 ↓ 1,237.6 9,901 1

Subquery Scan on tabela (cost=1.13..2,583.88 rows=8 width=22) (actual time=1.200..1,075.465 rows=9,901 loops=1)

4. 25.291 1,032.895 ↓ 1,237.6 9,901 1

Nested Loop (cost=1.13..2,583.38 rows=8 width=20) (actual time=1.175..1,032.895 rows=9,901 loops=1)

5. 16.113 47.207 ↓ 1,237.6 9,901 1

Nested Loop (cost=0.84..2,458.57 rows=8 width=21) (actual time=0.137..47.207 rows=9,901 loops=1)

  • Join Filter: (tb_corporate_event.cd_corporative_event_type = tb_corporate_event_type.cd_corporative_event_type)
  • Rows Removed by Join Filter: 52,215
6. 3.533 31.094 ↓ 639.9 10,238 1

Nested Loop (cost=0.84..2,455.07 rows=16 width=24) (actual time=0.113..31.094 rows=10,238 loops=1)

7. 0.542 5.691 ↓ 4.7 270 1

Nested Loop (cost=0.42..2,388.13 rows=57 width=16) (actual time=0.086..5.691 rows=270 loops=1)

8. 0.202 0.202 ↑ 1.0 291 1

Seq Scan on tb_stock_fii tb_stock_fii_1 (cost=0.00..33.91 rows=291 width=4) (actual time=0.018..0.202 rows=291 loops=1)

9. 4.947 4.947 ↑ 1.0 1 291

Index Scan using tb_stock_crypto_id_exchangec_id_stock_idx on tb_stock tb_stock_1 (cost=0.42..8.09 rows=1 width=12) (actual time=0.017..0.017 rows=1 loops=291)

  • Index Cond: ((id_exchange = 1) AND (id_stock = tb_stock_fii_1.id_stock))
  • Filter: (cd_status_stock = 'A'::bpchar)
  • Rows Removed by Filter: 0
10. 21.870 21.870 ↓ 1.7 38 270

Index Scan using tb_corporate_event_idx2 on tb_corporate_event (cost=0.42..0.95 rows=22 width=16) (actual time=0.007..0.081 rows=38 loops=270)

  • Index Cond: (id_stock = tb_stock_1.id_stock)
  • Filter: (cd_corporative_event_type <> 'A'::bpchar)
  • Rows Removed by Filter: 1
11. 0.000 0.000 ↑ 1.7 6 10,238

Materialize (cost=0.00..1.25 rows=10 width=12) (actual time=0.000..0.000 rows=6 loops=10,238)

12. 0.017 0.017 ↑ 1.2 8 1

Seq Scan on tb_corporate_event_type (cost=0.00..1.20 rows=10 width=12) (actual time=0.011..0.017 rows=8 loops=1)

  • Filter: in_provent_type_in_money
  • Rows Removed by Filter: 12
13. 19.802 19.802 ↑ 1.0 1 9,901

Index Only Scan using tb_company_pk on tb_company (cost=0.29..0.34 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=9,901)

  • Index Cond: (id_company = tb_stock_1.id_company)
  • Heap Fetches: 9,901
14.          

SubPlan (for Nested Loop)

15. 0.000 940.595 ↓ 0.0 0 9,901

Limit (cost=15.25..15.25 rows=1 width=12) (actual time=0.095..0.095 rows=0 loops=9,901)

16. 19.802 940.595 ↓ 0.0 0 9,901

Sort (cost=15.25..17.75 rows=1,000 width=12) (actual time=0.095..0.095 rows=0 loops=9,901)

  • Sort Key: tb1.data
  • Sort Method: quicksort Memory: 25kB
17. 920.793 920.793 ↑ 1,000.0 1 9,901

Function Scan on calcula_coeficiente_dividendos_split tb1 (cost=0.25..10.25 rows=1,000 width=12) (actual time=0.093..0.093 rows=1 loops=9,901)

18.          

CTE month_domain

19. 9.282 21.823 ↓ 1.0 9,224 1

WindowAgg (cost=829.04..1,243.71 rows=9,215 width=36) (actual time=9.560..21.823 rows=9,224 loops=1)

20. 7.513 12.541 ↓ 1.0 9,224 1

Sort (cost=829.04..852.08 rows=9,215 width=8) (actual time=9.548..12.541 rows=9,224 loops=1)

  • Sort Key: tb_stock_fii_month_domain_1.id_stock, tb_stock_fii_month_domain_1.dt_reference DESC
  • Sort Method: quicksort Memory: 817kB
21. 2.520 5.028 ↓ 1.0 9,224 1

Hash Right Join (cost=37.55..222.24 rows=9,215 width=8) (actual time=0.569..5.028 rows=9,224 loops=1)

  • Hash Cond: (tb_stock_fii_month_domain_1.id_stock = tb_stock_fii_2.id_stock)
22. 1.966 1.966 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain tb_stock_fii_month_domain_1 (cost=0.00..160.15 rows=9,215 width=8) (actual time=0.010..1.966 rows=9,215 loops=1)

23. 0.061 0.542 ↑ 1.0 291 1

Hash (cost=33.91..33.91 rows=291 width=4) (actual time=0.542..0.542 rows=291 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 19kB
24. 0.481 0.481 ↑ 1.0 291 1

Seq Scan on tb_stock_fii tb_stock_fii_2 (cost=0.00..33.91 rows=291 width=4) (actual time=0.024..0.481 rows=291 loops=1)

25.          

CTE close_by_month

26. 20.089 4,147.799 ↓ 21.8 6,461 1

Nested Loop (cost=906,382.02..918,835.97 rows=297 width=20) (actual time=1,753.623..4,147.799 rows=6,461 loops=1)

27. 439.370 1,756.523 ↓ 7.0 6,461 1

HashAggregate (cost=906,381.46..906,392.99 rows=922 width=12) (actual time=1,751.924..1,756.523 rows=6,461 loops=1)

  • Group Key: month_domain_1.id_stock, month_domain_1.dt_reference
28. 207.623 1,317.153 ↓ 1.1 1,253,718 1

Nested Loop (cost=0.61..898,135.32 rows=1,099,486 width=16) (actual time=0.235..1,317.153 rows=1,253,718 loops=1)

29. 2.650 2.650 ↓ 1.0 9,224 1

CTE Scan on month_domain month_domain_1 (cost=0.00..184.30 rows=9,215 width=16) (actual time=0.001..2.650 rows=9,224 loops=1)

30. 1,106.880 1,106.880 ↓ 1.1 136 9,224

Index Only Scan using tb_bar_one_day_crypto_pk on tb_bar_one_day tb_bar_one_day_1 (cost=0.61..96.25 rows=119 width=12) (actual time=0.009..0.120 rows=136 loops=9,224)

  • Index Cond: ((id_stock = month_domain_1.id_stock) AND (id_point <= CASE WHEN (month_domain_1.rn = 1) THEN (to_char((CURRENT_DATE)::timestamp with time zone, 'yyyyMMdd'::text))::integer ELSE (((((month_domain_1.dt_reference + 1))::character varying)::text || '01'::text))::integer END) AND (id_point >= (((((month_domain_1.dt_reference)::character varying)::text || '01'::text))::integer - 10000)))
  • Heap Fetches: 1,253,718
31. 77.532 77.532 ↑ 1.0 1 6,461

Index Scan using tb_bar_one_day_crypto_pk on tb_bar_one_day (cost=0.56..8.56 rows=1 width=18) (actual time=0.011..0.012 rows=1 loops=6,461)

  • Index Cond: ((id_stock = month_domain_1.id_stock) AND (id_point = ((max(tb_bar_one_day_1.id_point))::integer)))
32.          

SubPlan (for Nested Loop)

33. 6.461 2,293.655 ↑ 1.0 1 6,461

Limit (cost=15.25..15.25 rows=1 width=12) (actual time=0.355..0.355 rows=1 loops=6,461)

34. 32.305 2,287.194 ↑ 1,000.0 1 6,461

Sort (cost=15.25..17.75 rows=1,000 width=12) (actual time=0.354..0.354 rows=1 loops=6,461)

  • Sort Key: tb1_1.data
  • Sort Method: top-N heapsort Memory: 25kB
35. 2,254.889 2,254.889 ↑ 62.5 16 6,461

Function Scan on calcula_coeficiente_dividendos_split tb1_1 (cost=0.25..10.25 rows=1,000 width=12) (actual time=0.347..0.349 rows=16 loops=6,461)

36.          

CTE dividend_by_month

37. 12.597 1,308.212 ↓ 147.2 6,037 1

GroupAggregate (cost=236.82..237.64 rows=41 width=16) (actual time=1,291.531..1,308.212 rows=6,037 loops=1)

  • Group Key: month_domain_2.id_stock, month_domain_2.dt_reference
38. 28.213 1,295.615 ↓ 1,561.0 63,999 1

Sort (cost=236.82..236.92 rows=41 width=16) (actual time=1,291.517..1,295.615 rows=63,999 loops=1)

  • Sort Key: month_domain_2.id_stock, month_domain_2.dt_reference
  • Sort Method: quicksort Memory: 4,536kB
39. 177.399 1,267.402 ↓ 1,561.0 63,999 1

Hash Join (cost=0.26..235.72 rows=41 width=16) (actual time=1,088.711..1,267.402 rows=63,999 loops=1)

  • Hash Cond: (month_domain_2.id_stock = dividends.id_stock)
  • Join Filter: ((dividends.dt_event >= (((((month_domain_2.dt_reference - 100))::character varying)::text || '01'::text))::integer) AND (dividends.dt_event <= (((((month_domain_2.dt_reference + 1))::character varying)::text || '01'::text))::integer))
  • Rows Removed by Join Filter: 343,337
40. 1.344 1.344 ↓ 1.0 9,224 1

CTE Scan on month_domain month_domain_2 (cost=0.00..184.30 rows=9,215 width=8) (actual time=0.002..1.344 rows=9,224 loops=1)

41. 3.606 1,088.659 ↓ 1,237.6 9,901 1

Hash (cost=0.16..0.16 rows=8 width=16) (actual time=1,088.659..1,088.659 rows=9,901 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 593kB
42. 1,085.053 1,085.053 ↓ 1,237.6 9,901 1

CTE Scan on dividends (cost=0.00..0.16 rows=8 width=16) (actual time=1.206..1,085.053 rows=9,901 loops=1)

43.          

CTE liquidity_info_month

44. 58.352 315.193 ↓ 32.3 6,461 1

HashAggregate (cost=100,220.29..100,223.79 rows=200 width=40) (actual time=309.693..315.193 rows=6,461 loops=1)

  • Group Key: close_by_month_1.id_stock, close_by_month_1.dt_reference
45. 28.490 256.841 ↓ 3.3 118,639 1

Nested Loop (cost=0.56..99,865.92 rows=35,437 width=18) (actual time=0.043..256.841 rows=118,639 loops=1)

46. 2.216 2.216 ↓ 21.8 6,461 1

CTE Scan on close_by_month close_by_month_1 (cost=0.00..5.94 rows=297 width=12) (actual time=0.001..2.216 rows=6,461 loops=1)

47. 226.135 226.135 ↑ 6.6 18 6,461

Index Scan using tb_bar_one_day_crypto_pk on tb_bar_one_day tb_bar_one_day_2 (cost=0.56..335.04 rows=119 width=18) (actual time=0.008..0.035 rows=18 loops=6,461)

  • Index Cond: ((id_stock = close_by_month_1.id_stock) AND (id_point <= close_by_month_1.id_point) AND (id_point >= (close_by_month_1.id_point - 100)))
48.          

CTE month_cagrs

49. 9.957 231.940 ↓ 1.0 9,224 1

Hash Right Join (cost=13,546.09..14,540.25 rows=9,215 width=128) (actual time=226.554..231.940 rows=9,224 loops=1)

  • Hash Cond: (quota_data_five_year.id_stock_fii_month_quotaholders = cagr_five.id_stock_fii_month_quotaholders)
50. 4.748 4.748 ↑ 1.0 33,310 1

Seq Scan on tb_stock_fii_month_quotaholders quota_data_five_year (cost=0.00..777.10 rows=33,310 width=8) (actual time=0.015..4.748 rows=33,310 loops=1)

51. 4.963 217.235 ↓ 1.0 9,224 1

Hash (cost=13,430.90..13,430.90 rows=9,215 width=128) (actual time=217.235..217.235 rows=9,224 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 825kB
52. 3.099 212.272 ↓ 1.0 9,224 1

Hash Left Join (cost=12,364.14..13,430.90 rows=9,215 width=128) (actual time=200.876..212.272 rows=9,224 loops=1)

  • Hash Cond: (cagr_five.id_stock_fii_month_data = data_five_year.id_stock_fii_month_data)
53. 2.846 204.590 ↓ 1.0 9,224 1

Hash Left Join (cost=12,045.73..13,088.30 rows=9,215 width=112) (actual time=196.193..204.590 rows=9,224 loops=1)

  • Hash Cond: (cagr_four.id_stock_fii_month_data = data_four_year.id_stock_fii_month_data)
54. 3.044 195.193 ↓ 1.0 9,224 1

Hash Left Join (cost=11,727.33..12,745.69 rows=9,215 width=96) (actual time=189.542..195.193 rows=9,224 loops=1)

  • Hash Cond: (cagr_three.id_stock_fii_month_data = data_three_year.id_stock_fii_month_data)
55. 7.279 187.473 ↓ 1.0 9,224 1

Hash Right Join (cost=11,408.92..12,403.09 rows=9,215 width=80) (actual time=184.749..187.473 rows=9,224 loops=1)

  • Hash Cond: (quota_data_four_year.id_stock_fii_month_quotaholders = cagr_four.id_stock_fii_month_quotaholders)
56. 4.727 4.727 ↑ 1.0 33,310 1

Seq Scan on tb_stock_fii_month_quotaholders quota_data_four_year (cost=0.00..777.10 rows=33,310 width=8) (actual time=0.012..4.727 rows=33,310 loops=1)

57. 2.979 175.467 ↓ 1.0 9,224 1

Hash (cost=11,293.74..11,293.74 rows=9,215 width=80) (actual time=175.466..175.467 rows=9,224 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 803kB
58. 7.767 172.488 ↓ 1.0 9,224 1

Hash Right Join (cost=10,299.57..11,293.74 rows=9,215 width=80) (actual time=161.824..172.488 rows=9,224 loops=1)

  • Hash Cond: (quota_data_three_year.id_stock_fii_month_quotaholders = cagr_three.id_stock_fii_month_quotaholders)
59. 5.081 5.081 ↑ 1.0 33,310 1

Seq Scan on tb_stock_fii_month_quotaholders quota_data_three_year (cost=0.00..777.10 rows=33,310 width=8) (actual time=0.016..5.081 rows=33,310 loops=1)

60. 3.271 159.640 ↓ 1.0 9,224 1

Hash (cost=10,184.39..10,184.39 rows=9,215 width=80) (actual time=159.640..159.640 rows=9,224 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 803kB
61. 16.598 156.369 ↓ 1.0 9,224 1

Hash Right Join (cost=9,190.22..10,184.39 rows=9,215 width=80) (actual time=136.798..156.369 rows=9,224 loops=1)

  • Hash Cond: (quota_data_two_year.id_stock_fii_month_quotaholders = cagr_two.id_stock_fii_month_quotaholders)
62. 4.926 4.926 ↑ 1.0 33,310 1

Seq Scan on tb_stock_fii_month_quotaholders quota_data_two_year (cost=0.00..777.10 rows=33,310 width=8) (actual time=0.013..4.926 rows=33,310 loops=1)

63. 3.327 134.845 ↓ 1.0 9,224 1

Hash (cost=9,075.04..9,075.04 rows=9,215 width=80) (actual time=134.845..134.845 rows=9,224 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 803kB
64. 11.914 131.518 ↓ 1.0 9,224 1

Hash Right Join (cost=8,080.87..9,075.04 rows=9,215 width=80) (actual time=113.916..131.518 rows=9,224 loops=1)

  • Hash Cond: (quota_data_one_year.id_stock_fii_month_quotaholders = cagr_one.id_stock_fii_month_quotaholders)
65. 10.382 10.382 ↑ 1.0 33,310 1

Seq Scan on tb_stock_fii_month_quotaholders quota_data_one_year (cost=0.00..777.10 rows=33,310 width=8) (actual time=0.014..10.382 rows=33,310 loops=1)

66. 6.438 109.222 ↓ 1.0 9,224 1

Hash (cost=7,965.69..7,965.69 rows=9,215 width=80) (actual time=109.222..109.222 rows=9,224 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 798kB
67. 4.335 102.784 ↓ 1.0 9,224 1

Hash Left Join (cost=2,128.68..7,965.69 rows=9,215 width=80) (actual time=43.828..102.784 rows=9,224 loops=1)

  • Hash Cond: (cagr_two.id_stock_fii_month_data = data_two_year.id_stock_fii_month_data)
68. 4.644 93.824 ↓ 1.0 9,224 1

Hash Left Join (cost=1,810.28..7,623.08 rows=9,215 width=64) (actual time=39.105..93.824 rows=9,224 loops=1)

  • Hash Cond: (cagr_one.id_stock_fii_month_data = data_one_year.id_stock_fii_month_data)
69. 5.845 83.432 ↓ 1.0 9,224 1

Hash Left Join (cost=1,491.88..7,280.48 rows=9,215 width=48) (actual time=33.259..83.432 rows=9,224 loops=1)

  • Hash Cond: ((month_domain_3.id_stock = cagr_five.id_stock) AND (month_domain_3.cagr_five_year = cagr_five.dt_reference))
70. 5.608 73.629 ↓ 1.0 9,224 1

Hash Left Join (cost=1,193.50..5,861.24 rows=9,215 width=44) (actual time=29.211..73.629 rows=9,224 loops=1)

  • Hash Cond: ((month_domain_3.id_stock = cagr_four.id_stock) AND (month_domain_3.cagr_four_year = cagr_four.dt_reference))
71. 6.018 64.061 ↓ 1.0 9,224 1

Hash Left Join (cost=895.12..4,442.00 rows=9,215 width=40) (actual time=25.154..64.061 rows=9,224 loops=1)

  • Hash Cond: ((month_domain_3.id_stock = cagr_three.id_stock) AND (month_domain_3.cagr_three_year = cagr_three.dt_reference))
72. 4.831 54.075 ↓ 1.0 9,224 1

Hash Left Join (cost=596.75..3,022.77 rows=9,215 width=36) (actual time=21.091..54.075 rows=9,224 loops=1)

  • Hash Cond: ((month_domain_3.id_stock = cagr_two.id_stock) AND (month_domain_3.cagr_two_year = cagr_two.dt_reference))
73. 9.278 45.261 ↓ 1.0 9,224 1

Hash Left Join (cost=298.38..1,603.54 rows=9,215 width=32) (actual time=17.002..45.261 rows=9,224 loops=1)

  • Hash Cond: ((month_domain_3.id_stock = cagr_one.id_stock) AND (month_domain_3.cagr_one_year = cagr_one.dt_reference))
74. 28.564 28.564 ↓ 1.0 9,224 1

CTE Scan on month_domain month_domain_3 (cost=0.00..184.30 rows=9,215 width=28) (actual time=9.563..28.564 rows=9,224 loops=1)

75. 2.193 7.419 ↑ 1.0 9,215 1

Hash (cost=160.15..160.15 rows=9,215 width=16) (actual time=7.419..7.419 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 560kB
76. 5.226 5.226 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain cagr_one (cost=0.00..160.15 rows=9,215 width=16) (actual time=0.017..5.226 rows=9,215 loops=1)

77. 2.104 3.983 ↑ 1.0 9,215 1

Hash (cost=160.15..160.15 rows=9,215 width=16) (actual time=3.983..3.983 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 560kB
78. 1.879 1.879 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain cagr_two (cost=0.00..160.15 rows=9,215 width=16) (actual time=0.012..1.879 rows=9,215 loops=1)

79. 2.145 3.968 ↑ 1.0 9,215 1

Hash (cost=160.15..160.15 rows=9,215 width=16) (actual time=3.968..3.968 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 560kB
80. 1.823 1.823 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain cagr_three (cost=0.00..160.15 rows=9,215 width=16) (actual time=0.007..1.823 rows=9,215 loops=1)

81. 2.183 3.960 ↑ 1.0 9,215 1

Hash (cost=160.15..160.15 rows=9,215 width=16) (actual time=3.960..3.960 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 560kB
82. 1.777 1.777 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain cagr_four (cost=0.00..160.15 rows=9,215 width=16) (actual time=0.010..1.777 rows=9,215 loops=1)

83. 2.178 3.958 ↑ 1.0 9,215 1

Hash (cost=160.15..160.15 rows=9,215 width=16) (actual time=3.958..3.958 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 560kB
84. 1.780 1.780 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain cagr_five (cost=0.00..160.15 rows=9,215 width=16) (actual time=0.007..1.780 rows=9,215 loops=1)

85. 2.575 5.748 ↑ 1.0 9,218 1

Hash (cost=203.18..203.18 rows=9,218 width=24) (actual time=5.748..5.748 rows=9,218 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 654kB
86. 3.173 3.173 ↑ 1.0 9,218 1

Seq Scan on tb_stock_fii_month_data data_one_year (cost=0.00..203.18 rows=9,218 width=24) (actual time=0.011..3.173 rows=9,218 loops=1)

87. 2.619 4.625 ↑ 1.0 9,218 1

Hash (cost=203.18..203.18 rows=9,218 width=24) (actual time=4.625..4.625 rows=9,218 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 654kB
88. 2.006 2.006 ↑ 1.0 9,218 1

Seq Scan on tb_stock_fii_month_data data_two_year (cost=0.00..203.18 rows=9,218 width=24) (actual time=0.009..2.006 rows=9,218 loops=1)

89. 2.621 4.676 ↑ 1.0 9,218 1

Hash (cost=203.18..203.18 rows=9,218 width=24) (actual time=4.676..4.676 rows=9,218 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 654kB
90. 2.055 2.055 ↑ 1.0 9,218 1

Seq Scan on tb_stock_fii_month_data data_three_year (cost=0.00..203.18 rows=9,218 width=24) (actual time=0.012..2.055 rows=9,218 loops=1)

91. 2.638 6.551 ↑ 1.0 9,218 1

Hash (cost=203.18..203.18 rows=9,218 width=24) (actual time=6.551..6.551 rows=9,218 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 654kB
92. 3.913 3.913 ↑ 1.0 9,218 1

Seq Scan on tb_stock_fii_month_data data_four_year (cost=0.00..203.18 rows=9,218 width=24) (actual time=0.010..3.913 rows=9,218 loops=1)

93. 2.629 4.583 ↑ 1.0 9,218 1

Hash (cost=203.18..203.18 rows=9,218 width=24) (actual time=4.583..4.583 rows=9,218 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 654kB
94. 1.954 1.954 ↑ 1.0 9,218 1

Seq Scan on tb_stock_fii_month_data data_five_year (cost=0.00..203.18 rows=9,218 width=24) (actual time=0.011..1.954 rows=9,218 loops=1)

95. 32.726 6,306.456 ↓ 39.9 9,215 1

Nested Loop Left Join (cost=3,926.00..4,804.96 rows=231 width=1,399) (actual time=6,116.585..6,306.456 rows=9,215 loops=1)

96. 35.945 6,273.730 ↓ 39.9 9,215 1

Nested Loop Left Join (cost=3,925.72..4,721.74 rows=231 width=1,394) (actual time=6,116.570..6,273.730 rows=9,215 loops=1)

97. 41.585 6,237.785 ↓ 39.9 9,215 1

Nested Loop Left Join (cost=3,925.43..4,626.90 rows=231 width=1,373) (actual time=6,116.556..6,237.785 rows=9,215 loops=1)

98. 39.890 6,196.200 ↓ 39.9 9,215 1

Nested Loop Left Join (cost=3,925.14..4,369.26 rows=231 width=1,152) (actual time=6,116.540..6,196.200 rows=9,215 loops=1)

99. 329.792 6,156.310 ↓ 39.9 9,215 1

Hash Left Join (cost=3,924.86..4,285.45 rows=231 width=1,100) (actual time=6,116.497..6,156.310 rows=9,215 loops=1)

  • Hash Cond: ((tb_stock_fii.id_stock = liquidity_info_month.id_stock) AND (tb_stock_fii_month_domain.dt_reference = liquidity_info_month.dt_reference))
100. 15.007 5,826.518 ↓ 39.9 9,215 1

Hash Join (cost=3,917.86..4,265.73 rows=231 width=1,068) (actual time=5,796.399..5,826.518 rows=9,215 loops=1)

  • Hash Cond: ((month_cagrs.id_stock = tb_stock_fii.id_stock) AND (month_cagrs.dt_reference = tb_stock_fii_month_domain.dt_reference))
101. 241.690 241.690 ↓ 1.0 9,224 1

CTE Scan on month_cagrs (cost=0.00..184.30 rows=9,215 width=348) (actual time=226.558..241.690 rows=9,224 loops=1)

102. 10.715 5,569.821 ↓ 6.3 9,215 1

Hash (cost=3,895.97..3,895.97 rows=1,459 width=744) (actual time=5,569.821..5,569.821 rows=9,215 loops=1)

  • Buckets: 16,384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 6,531kB
103. 5.157 5,559.106 ↓ 6.3 9,215 1

Hash Left Join (cost=3,856.90..3,895.97 rows=1,459 width=744) (actual time=5,538.206..5,559.106 rows=9,215 loops=1)

  • Hash Cond: ((tb_stock_fii_month_domain.id_stock = dividend_by_month_less_one_year.id_stock) AND ((tb_stock_fii_month_domain.dt_reference - 100) = dividend_by_month_less_one_year.dt_reference))
104. 5.275 5,551.710 ↓ 6.3 9,215 1

Hash Left Join (cost=3,855.47..3,881.76 rows=1,459 width=736) (actual time=5,535.951..5,551.710 rows=9,215 loops=1)

  • Hash Cond: ((tb_stock_fii_month_domain.id_stock = dividend_by_month.id_stock) AND (tb_stock_fii_month_domain.dt_reference = dividend_by_month.dt_reference))
105. 9.326 4,234.606 ↓ 6.3 9,215 1

Hash Right Join (cost=3,854.03..3,869.34 rows=1,459 width=728) (actual time=4,224.103..4,234.606 rows=9,215 loops=1)

  • Hash Cond: ((close_by_month_less_one_year.id_stock = tb_stock_fii_month_domain.id_stock) AND (close_by_month_less_one_year.dt_reference = (tb_stock_fii_month_domain.dt_reference - 100)))
106. 1.213 1.213 ↓ 21.8 6,461 1

CTE Scan on close_by_month close_by_month_less_one_year (cost=0.00..5.94 rows=297 width=16) (actual time=0.003..1.213 rows=6,461 loops=1)

107. 12.586 4,224.067 ↓ 6.3 9,215 1

Hash (cost=3,832.15..3,832.15 rows=1,459 width=720) (actual time=4,224.067..4,224.067 rows=9,215 loops=1)

  • Buckets: 16,384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 6,396kB
108. 16.171 4,211.481 ↓ 6.3 9,215 1

Hash Right Join (cost=3,819.45..3,832.15 rows=1,459 width=720) (actual time=1,795.977..4,211.481 rows=9,215 loops=1)

  • Hash Cond: ((close_by_month.id_stock = tb_stock_fii_month_domain.id_stock) AND (close_by_month.dt_reference = tb_stock_fii_month_domain.dt_reference))
109. 4,152.985 4,152.985 ↓ 21.8 6,461 1

CTE Scan on close_by_month (cost=0.00..5.94 rows=297 width=16) (actual time=1,753.626..4,152.985 rows=6,461 loops=1)

110. 12.490 42.325 ↓ 6.3 9,215 1

Hash (cost=3,797.56..3,797.56 rows=1,459 width=712) (actual time=42.325..42.325 rows=9,215 loops=1)

  • Buckets: 16,384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 6,316kB
111. 6.764 29.835 ↓ 6.3 9,215 1

Hash Join (cost=2,815.40..3,797.56 rows=1,459 width=712) (actual time=21.655..29.835 rows=9,215 loops=1)

  • Hash Cond: ((month_domain.id_stock = tb_stock_fii.id_stock) AND (month_domain.dt_reference = tb_stock_fii_month_domain.dt_reference))
112. 1.524 1.524 ↓ 1.0 9,224 1

CTE Scan on month_domain (cost=0.00..184.30 rows=9,215 width=8) (actual time=0.001..1.524 rows=9,224 loops=1)

113. 7.895 21.547 ↑ 1.0 9,215 1

Hash (cost=2,677.17..2,677.17 rows=9,215 width=704) (actual time=21.546..21.547 rows=9,215 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 6,244kB
114. 5.975 13.652 ↑ 1.0 9,215 1

Hash Join (cost=2,390.32..2,677.17 rows=9,215 width=704) (actual time=6.591..13.652 rows=9,215 loops=1)

  • Hash Cond: (tb_stock_fii_month_domain.id_stock = tb_stock_fii.id_stock)
115. 1.123 1.123 ↑ 1.0 9,215 1

Seq Scan on tb_stock_fii_month_domain (cost=0.00..160.15 rows=9,215 width=28) (actual time=0.012..1.123 rows=9,215 loops=1)

116. 0.305 6.554 ↑ 1.0 291 1

Hash (cost=2,386.68..2,386.68 rows=291 width=676) (actual time=6.554..6.554 rows=291 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 171kB
117. 0.323 6.249 ↑ 1.0 291 1

Nested Loop (cost=0.42..2,386.68 rows=291 width=676) (actual time=0.101..6.249 rows=291 loops=1)

118. 0.106 0.106 ↑ 1.0 291 1

Seq Scan on tb_stock_fii (cost=0.00..33.91 rows=291 width=658) (actual time=0.007..0.106 rows=291 loops=1)

119. 5.820 5.820 ↑ 1.0 1 291

Index Scan using tb_stock_crypto_id_stock_idx on tb_stock (cost=0.42..8.09 rows=1 width=18) (actual time=0.020..0.020 rows=1 loops=291)

  • Index Cond: (id_stock = tb_stock_fii.id_stock)
120. 1.219 1,311.829 ↓ 147.2 6,037 1

Hash (cost=0.82..0.82 rows=41 width=16) (actual time=1,311.829..1,311.829 rows=6,037 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 347kB
121. 1,310.610 1,310.610 ↓ 147.2 6,037 1

CTE Scan on dividend_by_month (cost=0.00..0.82 rows=41 width=16) (actual time=1,291.535..1,310.610 rows=6,037 loops=1)

122. 2.239 2.239 ↓ 147.2 6,037 1

Hash (cost=0.82..0.82 rows=41 width=16) (actual time=2.238..2.239 rows=6,037 loops=1)