explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aMta

Settings
# exclusive inclusive rows x rows loops node
1. 0.025 3,054.990 ↑ 734.9 47 1

Limit (cost=1,388,582.40..110,005,280.34 rows=34,542 width=670) (actual time=3,035.159..3,054.990 rows=47 loops=1)

2. 1.723 3,054.965 ↑ 734.9 47 1

Result (cost=1,388,582.40..110,005,280.34 rows=34,542 width=670) (actual time=3,035.158..3,054.965 rows=47 loops=1)

3. 0.186 3,034.308 ↑ 734.9 47 1

Sort (cost=1,388,550.00..1,388,636.36 rows=34,542 width=364) (actual time=3,034.289..3,034.308 rows=47 loops=1)

  • Sort Key: (((a3.t6 / NULLIF((SubPlan 30), '0'::numeric)) - '1'::numeric)) NULLS FIRST, a1.id
  • Sort Method: quicksort Memory: 36kB
4. 0.427 3,034.122 ↑ 734.9 47 1

Nested Loop Left Join (cost=76,657.63..1,380,160.72 rows=34,542 width=364) (actual time=517.063..3,034.122 rows=47 loops=1)

5. 10.423 3,032.755 ↑ 734.9 47 1

Hash Left Join (cost=76,657.34..1,236,586.16 rows=34,542 width=170) (actual time=517.029..3,032.755 rows=47 loops=1)

  • Hash Cond: ((SubPlan 49) = a8.id)
6. 273.893 2,916.319 ↑ 734.9 47 1

Hash Left Join (cost=69,935.81..1,213,279.15 rows=34,542 width=154) (actual time=411.024..2,916.319 rows=47 loops=1)

  • Hash Cond: ((SubPlan 48) = a7.id)
  • Filter: (((a5.equity_pct__apc > '0'::numeric) AND (a5.equity_pct__apc IS NOT NULL)) OR ((COALESCE((SubPlan 54), CASE WHEN ((SubPlan 55) = ANY ('{Hold,""No Trade"",Cancelled,Completed}'::text[])) THEN (SubPlan 56) ELSE COALESCE(CASE WHEN ((SubPlan 57) <> ALL ('{Hold,""No Trade""}'::text[])) THEN a7.target_size ELSE NULL::numeric END, (SubPlan 58)) END, '0'::numeric) >= 0.0002) AND (COALESCE((SubPlan 63), CASE WHEN ((SubPlan 64) = ANY ('{Hold,""No Trade"",Cancelled,Completed}'::text[])) THEN (SubPlan 65) ELSE COALESCE(CASE WHEN ((SubPlan 66) <> ALL ('{Hold,""No Trade""}'::text[])) THEN a7.target_size ELSE NULL::numeric END, (SubPlan 67)) END, '0'::numeric) IS NOT NULL)) OR ((CASE WHEN a5.idealperfectlysized__srf THEN a5.equity_pct__apc ELSE a5.idealsize__srf END > '0'::numeric) AND (CASE WHEN a5.idealperfectlysized__srf THEN a5.equity_pct__apc ELSE a5.idealsize__srf END IS NOT NULL)))
  • Rows Removed by Filter: 57,631
7. 108.466 1,790.600 ↑ 1.1 57,678 1

Nested Loop Left Join (cost=63,357.28..1,177,679.75 rows=62,426 width=146) (actual time=272.748..1,790.600 rows=57,678 loops=1)

8. 84.400 1,393.744 ↓ 1.2 57,678 1

Nested Loop Left Join (cost=63,355.70..899,345.34 rows=49,721 width=99) (actual time=272.733..1,393.744 rows=57,678 loops=1)

9. 54.090 1,309.344 ↓ 1.2 57,678 1

Hash Left Join (cost=63,355.27..625,406.96 rows=49,721 width=95) (actual time=272.724..1,309.344 rows=57,678 loops=1)

  • Hash Cond: (a1.id = a10.stock_id)
10. 73.045 1,217.630 ↓ 1.2 57,678 1

Hash Left Join (cost=61,484.98..623,406.14 rows=49,721 width=86) (actual time=234.997..1,217.630 rows=57,678 loops=1)

  • Hash Cond: (a1.id = a6.stock_id)
11. 65.410 1,044.050 ↓ 1.2 57,678 1

Hash Left Join (cost=32,270.46..592,411.10 rows=49,721 width=75) (actual time=134.303..1,044.050 rows=57,678 loops=1)

  • Hash Cond: (a1.id = a5.stock_id)
12. 96.850 899.550 ↓ 1.2 57,678 1

Nested Loop Left Join (cost=2,979.38..561,525.49 rows=49,721 width=64) (actual time=54.982..899.550 rows=57,678 loops=1)

  • Filter: (a11.archive_on IS NULL)
  • Rows Removed by Filter: 7,537
13. 86.622 607.055 ↓ 1.0 65,215 1

Hash Join (cost=2,978.81..37,378.35 rows=63,942 width=68) (actual time=54.964..607.055 rows=65,215 loops=1)

  • Hash Cond: (a2.stock_id = a1.id)
14. 465.701 465.701 ↓ 1.0 65,216 1

Seq Scan on stock_fields a2 (cost=0.00..32,524.67 rows=63,943 width=64) (actual time=0.019..465.701 rows=65,216 loops=1)

  • Filter: ((parent_stock_id IS NULL) AND ct_inmaster_last AND (ct_inmaster_last IS NOT NULL) AND ((bb_stock_ticker_last !~* '^(betb\\ av)$'::text) OR (bb_stock_ticker_last IS NULL)) AND ((tag__2050 <> 22433) OR (tag__2050 IS NULL)))
  • Rows Removed by Filter: 20,029
15. 28.576 54.732 ↓ 1.0 85,246 1

Hash (cost=1,580.41..1,580.41 rows=85,232 width=8) (actual time=54.732..54.732 rows=85,246 loops=1)

  • Buckets: 131,072 Batches: 2 Memory Usage: 2,689kB
16. 26.156 26.156 ↓ 1.0 85,246 1

Seq Scan on stocks a1 (cost=0.00..1,580.41 rows=85,232 width=8) (actual time=0.007..26.156 rows=85,246 loops=1)

  • Filter: ((id IS NOT NULL) AND (id <> 87532))
  • Rows Removed by Filter: 1
17. 195.645 195.645 ↑ 1.0 1 65,215

Index Scan using entities_pkey on entities a11 (cost=0.57..8.19 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=65,215)

  • Index Cond: (id = a1.entity_id)
18. 25.544 79.090 ↑ 1.0 79,652 1

Hash (cost=27,889.58..27,889.58 rows=80,600 width=15) (actual time=79.090..79.090 rows=79,652 loops=1)

  • Buckets: 131,072 Batches: 2 Memory Usage: 2,429kB
19. 48.843 53.546 ↑ 1.0 79,652 1

Bitmap Heap Scan on stock_fields_fund_specific a5 (cost=1,509.08..27,889.58 rows=80,600 width=15) (actual time=4.935..53.546 rows=79,652 loops=1)

  • Recheck Cond: (fund_id = 3)
  • Heap Blocks: exact=1,984
20. 4.703 4.703 ↑ 1.0 79,654 1

Bitmap Index Scan on stock_fields_fund_specific_fund_stock_idx (cost=0.00..1,488.93 rows=80,600 width=0) (actual time=4.702..4.703 rows=79,654 loops=1)

  • Index Cond: (fund_id = 3)
21. 28.213 100.535 ↓ 1.0 79,638 1

Hash (cost=27,841.08..27,841.08 rows=78,995 width=15) (actual time=100.535..100.535 rows=79,638 loops=1)

  • Buckets: 131,072 Batches: 2 Memory Usage: 2,427kB
22. 67.197 72.322 ↓ 1.0 79,638 1

Bitmap Heap Scan on stock_fields_fund_specific a6 (cost=1,480.64..27,841.08 rows=78,995 width=15) (actual time=6.957..72.322 rows=79,638 loops=1)

  • Recheck Cond: (fund_id = 4)
  • Heap Blocks: exact=13,264
23. 5.125 5.125 ↓ 1.0 79,668 1

Bitmap Index Scan on stock_fields_fund_specific_fund_stock_idx (cost=0.00..1,460.89 rows=78,995 width=0) (actual time=5.124..5.125 rows=79,668 loops=1)

  • Index Cond: (fund_id = 4)
24. 19.981 37.624 ↓ 1.0 62,729 1

Hash (cost=1,086.24..1,086.24 rows=62,724 width=13) (actual time=37.623..37.624 rows=62,729 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 3,453kB
25. 17.643 17.643 ↓ 1.0 62,729 1

Seq Scan on factset_mappings a10 (cost=0.00..1,086.24 rows=62,724 width=13) (actual time=0.008..17.643 rows=62,729 loops=1)

26. 0.000 0.000 ↓ 0.0 0 57,678

Index Scan using private_company_fields_pkey on private_company_fields a4 (cost=0.43..5.51 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=57,678)

  • Index Cond: (id = a2.private_company_id)
27. 115.356 288.390 ↑ 1.0 1 57,678

Bitmap Heap Scan on price_history_cache a3 (cost=1.59..5.60 rows=1 width=51) (actual time=0.005..0.005 rows=1 loops=57,678)

  • Recheck Cond: (stock_id = a1.id)
  • Heap Blocks: exact=46,621
28. 173.034 173.034 ↑ 1.0 1 57,678

Bitmap Index Scan on price_history_cache_pkey (cost=0.00..1.59 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=57,678)

  • Index Cond: (stock_id = a1.id)
29. 51.227 102.542 ↑ 1.0 145,538 1

Hash (cost=4,047.79..4,047.79 rows=145,579 width=12) (actual time=102.541..102.542 rows=145,538 loops=1)

  • Buckets: 131,072 Batches: 4 Memory Usage: 2,514kB
30. 51.315 51.315 ↑ 1.0 145,538 1

Seq Scan on trade_requests a7 (cost=0.00..4,047.79 rows=145,579 width=12) (actual time=0.007..51.315 rows=145,538 loops=1)

31.          

SubPlan (for Hash Left Join)

32. 57.561 230.524 ↑ 1.0 1 57,631

Aggregate (cost=1,508.95..1,508.96 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=57,631)

33. 0.000 172.893 ↓ 0.0 0 57,631

Nested Loop Left Join (cost=9.72..471.63 rows=21 width=27) (actual time=0.003..0.003 rows=0 loops=57,631)

34. 57.631 172.893 ↓ 0.0 0 57,631

Nested Loop Left Join (cost=9.29..430.67 rows=21 width=20) (actual time=0.003..0.003 rows=0 loops=57,631)

35. 0.000 115.262 ↓ 0.0 0 57,631

Nested Loop (cost=0.71..247.23 rows=21 width=4) (actual time=0.002..0.002 rows=0 loops=57,631)

36. 115.262 115.262 ↓ 0.0 0 57,631

Index Scan using stock_fields_parent_stock_id_idx on stock_fields x4_1 (cost=0.42..72.71 rows=21 width=4) (actual time=0.002..0.002 rows=0 loops=57,631)

  • Index Cond: (parent_stock_id = a1.id)
37. 0.070 0.070 ↑ 1.0 1 35

Index Scan using stocks_pkey on stocks x1_1 (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (id = x4_1.stock_id)
38. 0.000 0.000 ↓ 0.0 0 35

Index Scan using trade_requests_pkey on trade_requests x2_1 (cost=8.58..8.74 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=35)

  • Index Cond: (id = (SubPlan 53))
39.          

SubPlan (for Index Scan)

40. 0.035 0.035 ↓ 0.0 0 35

Index Scan using active_trades_status_idx on trade_requests trade_requests_13 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=35)

  • Index Cond: ((stock_id = x1_1.id) AND (fund_id = 3))
41. 0.105 0.105 ↑ 1.0 1 35

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific x3_1 (cost=0.43..1.95 rows=1 width=11) (actual time=0.003..0.003 rows=1 loops=35)

  • Index Cond: ((fund_id = 3) AND (stock_id = x1_1.id))
42.          

SubPlan (for Aggregate)

43. 0.000 0.035 ↓ 0.0 0 35

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=35)

44. 0.035 0.035 ↓ 0.0 0 35

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_10 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=35)

  • Index Cond: ((stock_id = x1_1.id) AND (fund_id = 3))
  • Heap Fetches: 0
45. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_7 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_10.status)
46. 0.000 0.035 ↓ 0.0 0 35

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=35)

47. 0.035 0.035 ↓ 0.0 0 35

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_11 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=35)

  • Index Cond: ((stock_id = x1_1.id) AND (fund_id = 3))
  • Heap Fetches: 0
48. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_8 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_11.status)
49. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_12 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1_1.id) AND (fund_id = 3))
  • Heap Fetches: 0
51. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_9 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_12.status)
52. 0.000 57.631 ↓ 0.0 0 57,631

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=57,631)

53. 57.631 57.631 ↓ 0.0 0 57,631

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_14 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=57,631)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 7
54. 0.035 0.035 ↑ 1.0 1 7

Index Scan using tag_values_pkey on tag_values tag_values_10 (cost=0.29..8.30 rows=1 width=15) (actual time=0.005..0.005 rows=1 loops=7)

  • Index Cond: (id = trade_requests_14.status)
55. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=32) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_3 (cost=0.43..8.45 rows=1 width=7) (never executed)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
57. 0.000 57.631 ↓ 0.0 0 57,631

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=57,631)

58. 57.631 57.631 ↓ 0.0 0 57,631

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_15 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=57,631)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 7
59. 0.014 0.014 ↑ 1.0 1 7

Index Scan using tag_values_pkey on tag_values tag_values_11 (cost=0.29..8.30 rows=1 width=15) (actual time=0.002..0.002 rows=1 loops=7)

  • Index Cond: (id = trade_requests_15.status)
60. 115.248 288.120 ↑ 1.0 1 57,624

Aggregate (cost=8.45..8.46 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=57,624)

61. 172.872 172.872 ↑ 1.0 1 57,624

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_4 (cost=0.43..8.45 rows=1 width=7) (actual time=0.003..0.003 rows=1 loops=57,624)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
62. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1,508.95..1,508.96 rows=1 width=32) (never executed)

63. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=9.72..471.63 rows=21 width=27) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=9.29..430.67 rows=21 width=20) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.71..247.23 rows=21 width=4) (never executed)

66. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_parent_stock_id_idx on stock_fields x4_2 (cost=0.42..72.71 rows=21 width=4) (never executed)

  • Index Cond: (parent_stock_id = a1.id)
67. 0.000 0.000 ↓ 0.0 0

Index Scan using stocks_pkey on stocks x1_2 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (id = x4_2.stock_id)
68. 0.000 0.000 ↓ 0.0 0

Index Scan using trade_requests_pkey on trade_requests x2_2 (cost=8.58..8.74 rows=1 width=20) (never executed)

  • Index Cond: (id = (SubPlan 62))
69.          

SubPlan (for Index Scan)

70. 0.000 0.000 ↓ 0.0 0

Index Scan using active_trades_status_idx on trade_requests trade_requests_19 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1_2.id) AND (fund_id = 3))
71. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific x3_2 (cost=0.43..1.95 rows=1 width=11) (never executed)

  • Index Cond: ((fund_id = 3) AND (stock_id = x1_2.id))
72.          

SubPlan (for Aggregate)

73. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

74. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_16 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1_2.id) AND (fund_id = 3))
  • Heap Fetches: 0
75. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_12 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_16.status)
76. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_17 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1_2.id) AND (fund_id = 3))
  • Heap Fetches: 0
78. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_13 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_17.status)
79. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

80. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_18 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1_2.id) AND (fund_id = 3))
  • Heap Fetches: 0
81. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_14 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_18.status)
82. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

83. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_20 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 0
84. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_15 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_20.status)
85. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=32) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_5 (cost=0.43..8.45 rows=1 width=7) (never executed)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
87. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

88. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_21 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 0
89. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_16 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_21.status)
90. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=32) (never executed)

91. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_6 (cost=0.43..8.45 rows=1 width=7) (never executed)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
92. 57.689 115.378 ↓ 0.0 0 57,689

Limit (cost=0.14..8.16 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=57,689)

93. 57.689 57.689 ↓ 0.0 0 57,689

Index Scan using active_trades_status_idx on trade_requests trade_requests_8 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=57,689)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
94. 53.454 105.911 ↑ 1.0 145,538 1

Hash (cost=4,047.79..4,047.79 rows=145,579 width=20) (actual time=105.911..105.911 rows=145,538 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,291kB
95. 52.457 52.457 ↑ 1.0 145,538 1

Seq Scan on trade_requests a8 (cost=0.00..4,047.79 rows=145,579 width=20) (actual time=0.006..52.457 rows=145,538 loops=1)

96.          

SubPlan (for Hash Left Join)

97. 0.102 0.102 ↓ 0.0 0 51

Index Scan using active_trades_status_idx on trade_requests trade_requests_9 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.002 rows=0 loops=51)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
98. 0.470 0.470 ↑ 1.0 1 47

Index Scan using stock_fields_extension_stock_id_idx on stock_fields_extension a9 (cost=0.29..0.56 rows=1 width=12) (actual time=0.010..0.010 rows=1 loops=47)

  • Index Cond: (stock_id = a1.id)
99.          

SubPlan (for Nested Loop Left Join)

100. 0.094 0.470 ↑ 1.0 1 47

Limit (cost=0.56..3.58 rows=1 width=26) (actual time=0.009..0.010 rows=1 loops=47)

101. 0.376 0.376 ↑ 8.0 1 47

Index Scan Backward using price_history_new_stock_id_price_date_price_usd_split_adjusted_ on price_history_raw price_history_raw_3 (cost=0.56..24.71 rows=8 width=26) (actual time=0.008..0.008 rows=1 loops=47)

  • Index Cond: ((stock_id = a1.id) AND (price_date <= '2020-09-02'::date) AND (price_date > '2020-08-25'::date))
102.          

SubPlan (for Result)

103. 0.047 0.470 ↑ 1.0 1 47

Aggregate (cost=250.25..250.26 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=47)

104. 0.246 0.423 ↓ 0.0 0 47

Index Scan using stock_fields_parent_stock_id_idx on stock_fields sf (cost=0.42..250.22 rows=11 width=8) (actual time=0.009..0.009 rows=0 loops=47)

  • Index Cond: (parent_stock_id = a1.id)
  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 1
105.          

SubPlan (for Index Scan)

106. 0.177 0.177 ↑ 1.0 1 59

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific sff (cost=0.43..8.45 rows=1 width=1) (actual time=0.003..0.003 rows=1 loops=59)

  • Index Cond: ((fund_id = 3) AND (stock_id = sf.stock_id))
107. 0.329 0.329 ↑ 1.0 1 47

Index Scan using stock_fields_stock_id_ticker_idx on stock_fields (cost=0.42..8.44 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=47)

  • Index Cond: (stock_id = a1.id)
108. 0.007 0.007 ↓ 0.0 0 7

Index Scan using stock_fields_stock_id_ticker_idx on stock_fields stock_fields_1 (cost=0.42..8.44 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=7)

  • Index Cond: (stock_id = a4.stock_id)
109. 0.042 0.042 ↑ 1.0 1 7

Index Scan using private_company_fields_id_idx on private_company_fields (cost=0.43..8.45 rows=1 width=6) (actual time=0.005..0.006 rows=1 loops=7)

  • Index Cond: (id = a4.id)
110. 0.164 0.987 ↑ 1.0 1 47

Aggregate (cost=1,508.95..1,508.96 rows=1 width=32) (actual time=0.021..0.021 rows=1 loops=47)

111. 0.070 0.705 ↑ 21.0 1 47

Nested Loop Left Join (cost=9.72..471.63 rows=21 width=27) (actual time=0.004..0.015 rows=1 loops=47)

112. 0.188 0.517 ↑ 21.0 1 47

Nested Loop Left Join (cost=9.29..430.67 rows=21 width=20) (actual time=0.003..0.011 rows=1 loops=47)

113. 0.117 0.329 ↑ 21.0 1 47

Nested Loop (cost=0.71..247.23 rows=21 width=4) (actual time=0.002..0.007 rows=1 loops=47)

114. 0.094 0.094 ↑ 21.0 1 47

Index Scan using stock_fields_parent_stock_id_idx on stock_fields x4 (cost=0.42..72.71 rows=21 width=4) (actual time=0.002..0.002 rows=1 loops=47)

  • Index Cond: (parent_stock_id = a1.id)
115. 0.118 0.118 ↑ 1.0 1 59

Index Scan using stocks_pkey on stocks x1 (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=59)

  • Index Cond: (id = x4.stock_id)
116. 0.000 0.000 ↓ 0.0 0 59

Index Scan using trade_requests_pkey on trade_requests x2 (cost=8.58..8.74 rows=1 width=20) (actual time=0.000..0.000 rows=0 loops=59)

  • Index Cond: (id = (SubPlan 9))
117.          

SubPlan (for Index Scan)

118. 0.059 0.059 ↓ 0.0 0 59

Index Scan using active_trades_status_idx on trade_requests trade_requests_3 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=59)

  • Index Cond: ((stock_id = x1.id) AND (fund_id = 3))
119. 0.118 0.118 ↑ 1.0 1 59

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific x3 (cost=0.43..1.95 rows=1 width=11) (actual time=0.002..0.002 rows=1 loops=59)

  • Index Cond: ((fund_id = 3) AND (stock_id = x1.id))
120.          

SubPlan (for Aggregate)

121. 0.000 0.059 ↓ 0.0 0 59

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=59)

122. 0.059 0.059 ↓ 0.0 0 59

Index Only Scan using active_trades_status_idx on trade_requests (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=59)

  • Index Cond: ((stock_id = x1.id) AND (fund_id = 3))
  • Heap Fetches: 0
123. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests.status)
124. 0.000 0.059 ↓ 0.0 0 59

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=59)

125. 0.059 0.059 ↓ 0.0 0 59

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_1 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=59)

  • Index Cond: ((stock_id = x1.id) AND (fund_id = 3))
  • Heap Fetches: 0
126. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_1 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_1.status)
127. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..16.46 rows=1 width=11) (never executed)

128. 0.000 0.000 ↓ 0.0 0

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_2 (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: ((stock_id = x1.id) AND (fund_id = 3))
  • Heap Fetches: 0
129. 0.000 0.000 ↓ 0.0 0

Index Scan using tag_values_pkey on tag_values tag_values_2 (cost=0.29..8.30 rows=1 width=15) (never executed)

  • Index Cond: (id = trade_requests_2.status)
130. 0.080 0.138 ↓ 0.0 0 46

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.002..0.003 rows=0 loops=46)

131. 0.046 0.046 ↓ 0.0 0 46

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_4 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=46)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 4
132. 0.012 0.012 ↑ 1.0 1 4

Index Scan using tag_values_pkey on tag_values tag_values_3 (cost=0.29..8.30 rows=1 width=15) (actual time=0.003..0.003 rows=1 loops=4)

  • Index Cond: (id = trade_requests_4.status)
133. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=32) (never executed)

134. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific (cost=0.43..8.45 rows=1 width=7) (never executed)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
135. 0.038 0.092 ↓ 0.0 0 46

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=46)

136. 0.046 0.046 ↓ 0.0 0 46

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_5 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=46)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 4
137. 0.008 0.008 ↑ 1.0 1 4

Index Scan using tag_values_pkey on tag_values tag_values_4 (cost=0.29..8.30 rows=1 width=15) (actual time=0.002..0.002 rows=1 loops=4)

  • Index Cond: (id = trade_requests_5.status)
138. 0.084 0.336 ↑ 1.0 1 42

Aggregate (cost=8.45..8.46 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=42)

139. 0.252 0.252 ↑ 1.0 1 42

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_1 (cost=0.43..8.45 rows=1 width=7) (actual time=0.006..0.006 rows=1 loops=42)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id))
140. 0.083 0.083 ↓ 1.1 94 1

Index Only Scan using stock_fields_parent_stock_id_idx on stock_fields stock_fields_2 (cost=0.42..32.18 rows=85 width=4) (actual time=0.008..0.083 rows=94 loops=1)

  • Index Cond: (parent_stock_id IS NOT NULL)
  • Heap Fetches: 43
141. 0.002 0.128 ↑ 1.0 1 1

Aggregate (cost=176.36..176.37 rows=1 width=32) (actual time=0.128..0.128 rows=1 loops=1)

142. 0.001 0.126 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.98..176.35 rows=1 width=15) (actual time=0.126..0.126 rows=0 loops=1)

143. 0.024 0.125 ↓ 0.0 0 1

Nested Loop (cost=0.55..168.14 rows=1 width=16) (actual time=0.125..0.125 rows=0 loops=1)

144. 0.042 0.042 ↓ 2.8 59 1

Index Scan using stock_fields_parent_stock_id_idx on stock_fields b2 (cost=0.42..72.71 rows=21 width=4) (actual time=0.006..0.042 rows=59 loops=1)

  • Index Cond: (parent_stock_id = a1.id)
145. 0.059 0.059 ↓ 0.0 0 59

Index Scan using active_trades_status_idx on trade_requests b1 (cost=0.14..4.54 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=59)

  • Index Cond: ((stock_id = b2.stock_id) AND (fund_id = 3))
  • Filter: ((status IS NULL) OR (status <> ALL ('{1400,1403,1404,10882}'::integer[])))
146. 0.000 0.000 ↓ 0.0 0

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific b3 (cost=0.43..8.21 rows=1 width=15) (never executed)

  • Index Cond: ((b1.fund_id = fund_id) AND (fund_id = 3) AND (b1.stock_id = stock_id))
147. 0.038 0.092 ↓ 0.0 0 46

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=46)

148. 0.046 0.046 ↓ 0.0 0 46

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_6 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=46)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 4
149. 0.008 0.008 ↑ 1.0 1 4

Index Scan using tag_values_pkey on tag_values tag_values_5 (cost=0.29..8.30 rows=1 width=15) (actual time=0.002..0.002 rows=1 loops=4)

  • Index Cond: (id = trade_requests_6.status)
150. 0.046 0.046 ↓ 0.0 0 46

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific stock_fields_fund_specific_2 (cost=0.43..8.45 rows=1 width=7) (actual time=0.001..0.001 rows=0 loops=46)

  • Index Cond: ((fund_id = a8.fund_id) AND (stock_id = a8.stock_id))
151. 0.039 0.094 ↓ 0.0 0 47

Nested Loop (cost=0.42..16.46 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=47)

152. 0.047 0.047 ↓ 0.0 0 47

Index Only Scan using active_trades_status_idx on trade_requests trade_requests_7 (cost=0.14..8.16 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=47)

  • Index Cond: ((stock_id = a1.id) AND (fund_id = 3))
  • Heap Fetches: 4
153. 0.008 0.008 ↑ 1.0 1 4

Index Scan using tag_values_pkey on tag_values tag_values_6 (cost=0.29..8.30 rows=1 width=15) (actual time=0.002..0.002 rows=1 loops=4)

  • Index Cond: (id = trade_requests_7.status)
154. 0.363 3.431 ↑ 1.0 1 47

Aggregate (cost=794.17..794.19 rows=1 width=32) (actual time=0.073..0.073 rows=1 loops=47)

155. 0.093 1.128 ↑ 16.0 1 47

Nested Loop (cost=1.71..419.60 rows=16 width=23) (actual time=0.005..0.024 rows=1 loops=47)

156. 0.117 0.799 ↑ 20.0 1 47

Nested Loop (cost=1.14..257.36 rows=20 width=27) (actual time=0.004..0.017 rows=1 loops=47)

  • Join Filter: (sf_1.stock_id = s.id)
157. 0.105 0.564 ↑ 20.0 1 47

Nested Loop (cost=0.85..250.17 rows=20 width=27) (actual time=0.003..0.012 rows=1 loops=47)

158. 0.282 0.282 ↑ 21.0 1 47

Index Scan using stock_fields_parent_stock_id_idx on stock_fields sf_1 (cost=0.42..72.71 rows=21 width=12) (actual time=0.002..0.006 rows=1 loops=47)

  • Index Cond: (parent_stock_id = a1.id)
159. 0.177 0.177 ↑ 1.0 1 59

Index Scan using stock_fields_fund_specific_fund_stock_idx on stock_fields_fund_specific sff_1 (cost=0.43..8.45 rows=1 width=15) (actual time=0.003..0.003 rows=1 loops=59)

  • Index Cond: ((fund_id = 3) AND (stock_id = sf_1.stock_id))
160. 0.118 0.118 ↑ 1.0 1 59

Index Scan using stocks_pkey on stocks s (cost=0.29..0.35 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=59)

  • Index Cond: (id = sff_1.stock_id)
161. 0.236 0.236 ↑ 1.0 1 59

Index Only Scan using entities_archive_on_cond_idx on entities e (cost=0.57..8.11 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=59)

  • Index Cond: (id = s.entity_id)
  • Heap Fetches: 59
162.          

SubPlan (for Aggregate)

163. 0.216 0.232 ↑ 1.0 1 58

Index Scan using positions_fund_id_stock_id_date_id_key on positions positions_1 (cost=0.78..8.80 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=58)

  • Index Cond: ((fund_id = sff_1.fund_id) AND (stock_id = sf_1.stock_id) AND (date_id = $42))
164.          

Initplan (for Index Scan)

165. 0.002 0.016 ↑ 1.0 1 1

Limit (cost=0.30..0.35 rows=1 width=8) (actual time=0.015..0.016 rows=1 loops=1)

166. 0.014 0.014 ↑ 29,866.0 1 1

Index Scan Backward using dates_date_idx on dates dates_1 (cost=0.30..1,421.72 rows=29,866 width=8) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (date <= (timezone('America/New_York'::text, now()))::date)
  • Filter: is_coatue_trading_day
167. 0.162 0.174 ↑ 1.0 1 58

Index Scan using positions_fund_id_stock_id_date_id_key on positions (cost=0.78..8.80 rows=1 width=32) (actual time=0.002..0.003 rows=1 loops=58)

  • Index Cond: ((fund_id = sff_1.fund_id) AND (stock_id = sf_1.stock_id) AND (date_id = $33))
168.          

Initplan (for Index Scan)

169. 0.001 0.012 ↑ 1.0 1 1

Limit (cost=0.30..0.35 rows=1 width=8) (actual time=0.011..0.012 rows=1 loops=1)

170. 0.011 0.011 ↑ 29,866.0 1 1

Index Scan Backward using dates_date_idx on dates (cost=0.30..1,421.72 rows=29,866 width=8) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: (date <= (timezone('America/New_York'::text, now()))::date)
  • Filter: is_coatue_trading_day
171. 0.059 0.649 ↑ 1.0 1 59

Limit (cost=0.57..2.88 rows=1 width=26) (actual time=0.011..0.011 rows=1 loops=59)

172. 0.590 0.590 ↑ 8,405.0 1 59

Index Scan Backward using price_history_new_stock_id_price_date_all_idx on price_history_raw (cost=0.57..19,412.42 rows=8,405 width=26) (actual time=0.009..0.010 rows=1 loops=59)

  • Index Cond: ((stock_id = CASE WHEN (sf_1.tag__605 = ANY ('{1307,1306}'::integer[])) THEN sf_1.underlying_equity_id ELSE sf_1.stock_id END) AND (price_date <= CURRENT_DATE))
173. 0.118 0.885 ↑ 1.0 1 59

Limit (cost=0.58..2.90 rows=1 width=26) (actual time=0.014..0.015 rows=1 loops=59)

174. 0.767 0.767 ↑ 347.0 1 59

Index Scan using price_history_new_stock_id_price_date_all_idx on price_history_raw price_history_raw_1 (cost=0.58..805.88 rows=347 width=26) (actual time=0.013..0.013 rows=1 loops=59)

  • Index Cond: ((stock_id = CASE WHEN (sf_1.tag__605 = ANY ('{1307,1306}'::integer[])) THEN sf_1.underlying_equity_id ELSE sf_1.stock_id END) AND (price_date >= date_trunc('year'::text, (CURRENT_DATE)::timestamp with time zone)))
175. 0.014 0.063 ↓ 0.0 0 7

Limit (cost=0.58..2.90 rows=1 width=26) (actual time=0.009..0.009 rows=0 loops=7)

176. 0.049 0.049 ↓ 0.0 0 7

Index Scan using price_history_new_stock_id_price_date_all_idx on price_history_raw price_history_raw_2 (cost=0.58..805.88 rows=347 width=26) (actual time=0.007..0.007 rows=0 loops=7)

  • Index Cond: ((stock_id = a1.id) AND (price_date >= date_trunc('year'::text, (CURRENT_DATE)::timestamp with time zone)))
177. 2.010 8.131 ↑ 1.0 1 47

Aggregate (cost=169.33..169.34 rows=1 width=32) (actual time=0.173..0.173 rows=1 loops=47)

178.          

Initplan (for Aggregate)

179. 0.011 0.011 ↑ 1.0 1 1

Index Scan using dates_date_is_coatue_trading_day_idx on dates dates_2 (cost=0.30..8.32 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (date = make_date((date_part('year'::text, (CURRENT_DATE)::timestamp without time zone))::integer, 1, 1))
180. 6.110 6.110 ↓ 2.7 122 47

Index Scan using positions_fund_id_stock_id_date_id_key on positions positions_2 (cost=0.43..160.90 rows=45 width=6) (actual time=0.008..0.130 rows=122 loops=47)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id) AND (date_id >= $50))
181. 0.235 0.564 ↑ 1.0 1 47

Result (cost=33.71..33.74 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=47)

182.          

Initplan (for Result)

183. 0.160 0.188 ↑ 1.0 1 47

Index Scan using positions_fund_id_stock_id_date_id_key on positions positions_3 (cost=8.93..16.95 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=47)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id) AND (date_id = $53))
184.          

Initplan (for Index Scan)

185. 0.002 0.028 ↑ 1.0 1 1

Limit (cost=8.50..8.50 rows=1 width=4) (actual time=0.026..0.028 rows=1 loops=1)

186. 0.009 0.026 ↑ 6.0 1 1

Sort (cost=8.50..8.51 rows=6 width=4) (actual time=0.025..0.026 rows=1 loops=1)

  • Sort Key: dates_3.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
187. 0.017 0.017 ↑ 1.0 6 1

Index Scan using dates_date_idx on dates dates_3 (cost=0.31..8.47 rows=6 width=4) (actual time=0.014..0.017 rows=6 loops=1)

  • Index Cond: ((date <= (timezone('America/New_York'::text, now()))::date) AND (date >= ((timezone('America/New_York'::text, now()))::date - 7)))
  • Filter: is_coatue_trading_day
  • Rows Removed by Filter: 2
188. 0.136 0.141 ↑ 1.0 1 47

Index Scan using positions_fund_id_stock_id_date_id_key on positions positions_4 (cost=8.74..16.76 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=47)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id) AND (date_id = $56))
189.          

Initplan (for Index Scan)

190. 0.005 0.005 ↑ 1.0 1 1

Index Scan using dates_date_is_coatue_trading_day_idx on dates dates_4 (cost=0.29..8.31 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (date = '2020-09-01'::date)
191. 0.136 0.141 ↑ 1.0 1 47

Index Scan using positions_fund_id_stock_id_date_id_key on positions positions_5 (cost=8.74..16.77 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=47)

  • Index Cond: ((fund_id = 3) AND (stock_id = a1.id) AND (date_id = $58))
192.          

Initplan (for Index Scan)

193. 0.005 0.005 ↑ 1.0 1 1

Index Scan using dates_date_is_coatue_trading_day_idx on dates dates_5 (cost=0.30..8.31 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (date = (timezone('EST'::text, now()))::date)
194. 0.047 0.282 ↑ 1.0 1 47

Limit (cost=0.57..2.88 rows=1 width=26) (actual time=0.006..0.006 rows=1 loops=47)

195. 0.235 0.235 ↑ 8,408.0 1 47

Index Scan Backward using price_history_new_stock_id_price_date_all_idx on price_history_raw price_history_raw_4 (cost=0.57..19,398.30 rows=8,408 width=26) (actual time=0.005..0.005 rows=1 loops=47)

  • Index Cond: (stock_id = a2.countryindextickerid)
196. 0.094 0.282 ↑ 1.0 1 47

Limit (cost=0.58..2.89 rows=1 width=26) (actual time=0.006..0.006 rows=1 loops=47)

197. 0.188 0.188 ↑ 8,365.0 1 47

Index Scan Backward using price_history_new_stock_id_price_date_all_idx on price_history_raw price_history_raw_5 (cost=0.58..19,320.40 rows=8,365 width=26) (actual time=0.004..0.004 rows=1 loops=47)

  • Index Cond: ((stock_id = a2.countryindextickerid) AND (price_date <= ((CURRENT_DATE - '1 mon'::interval))::date))
198. 0.141 0.282 ↑ 1.0 1 47

Bitmap Heap Scan on price_history_cache (cost=4.43..8.44 rows=1 width=7) (actual time=0.005..0.006 rows=1 loops=47)

  • Recheck Cond: (stock_id = a2.countryindextickerid)
  • Heap Blocks: exact=82
199. 0.141 0.141 ↓ 2.0 2 47

Bitmap Index Scan on price_history_cache_stock_id_idx1 (cost=0.00..4.43 rows=1 width=0) (actual time=0.003..0.003 rows=2 loops=47)

  • Index Cond: (stock_id = a2.countryindextickerid)
200. 0.094 0.188 ↑ 1.0 1 47

Bitmap Heap Scan on price_history_cache price_history_cache_1 (cost=4.43..8.44 rows=1 width=6) (actual time=0.004..0.004 rows=1 loops=47)

  • Recheck Cond: (stock_id = a2.countryindextickerid)
  • Heap Blocks: exact=82
201. 0.094 0.094 ↓ 2.0 2 47

Bitmap Index Scan on price_history_cache_stock_id_idx1 (cost=0.00..4.43 rows=1 width=0) (actual time=0.002..0.002 rows=2 loops=47)

  • Index Cond: (stock_id = a2.countryindextickerid)
202. 0.094 0.188 ↑ 1.0 1 47

Bitmap Heap Scan on price_history_cache price_history_cache_2 (cost=4.43..8.44 rows=1 width=7) (actual time=0.003..0.004 rows=1 loops=47)

  • Recheck Cond: (stock_id = a2.countryindextickerid)
  • Heap Blocks: exact=82
203. 0.094 0.094 ↓ 2.0 2 47

Bitmap Index Scan on price_history_cache_stock_id_idx1 (cost=0.00..4.43 rows=1 width=0) (actual time=0.002..0.002 rows=2 loops=47)

  • Index Cond: (stock_id = a2.countryindextickerid)
204. 0.094 0.188 ↑ 1.0 1 47

Bitmap Heap Scan on price_history_cache price_history_cache_3 (cost=4.43..8.44 rows=1 width=7) (actual time=0.003..0.004 rows=1 loops=47)

  • Recheck Cond: (stock_id = a2.countryindextickerid)
  • Heap Blocks: exact=82
205. 0.094 0.094 ↓ 2.0 2 47

Bitmap Index Scan on price_history_cache_stock_id_idx1 (cost=0.00..4.43 rows=1 width=0) (actual time=0.002..0.002 rows=2 loops=47)

  • Index Cond: (stock_id = a2.countryindextickerid)
206. 0.141 0.564 ↑ 1.0 1 47

Aggregate (cost=15.85..15.86 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=47)

207. 0.141 0.423 ↑ 1.0 3 47

Bitmap Heap Scan on fe_v4_fe_basic_conh_qf_ny_mat (cost=4.45..15.85 rows=3 width=8) (actual time=0.008..0.009 rows=3 loops=47)

  • Recheck Cond: ((stock_id = a1.id) AND ((fe_item)::text = 'EPS'::text))
  • Heap Blocks: exact=58
208. 0.282 0.282 ↑ 1.0 3 47

Bitmap Index Scan on fe_v4_fe_basic_conh_qf_ny_mat_stock_item_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.006..0.006 rows=3 loops=47)

  • Index Cond: ((stock_id = a1.id) AND ((fe_item)::text = 'EPS'::text))
209. 1.222 1.504 ↑ 1.0 1 47

Seq Scan on currencies (cost=4.72..8.03 rows=1 width=6) (actual time=0.024..0.032 rows=1 loops=47)

  • Filter: (currency = ($68)::text)
  • Rows Removed by Filter: 86
210.          

Initplan (for Seq Scan)

211. 0.047 0.282 ↑ 1.0 1 47

Limit (cost=0.42..4.72 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=47)

212. 0.235 0.235 ↑ 14.0 1 47

Index Scan using fe_v4_fe_basic_conh_af_n8y_mat_stock_item_idx on fe_v4_fe_basic_conh_af_n8y_mat (cost=0.42..60.62 rows=14 width=4) (actual time=0.004..0.005 rows=1 loops=47)

  • Index Cond: (stock_id = a1.id)
213. 0.282 0.282 ↑ 1.0 1 47

Index Scan using stock_company_fields_mat_fsym_id_idx on stock_company_fields_mat (cost=0.29..8.31 rows=1 width=25) (actual time=0.006..0.006 rows=1 loops=47)

  • Index Cond: (fsym_id = a10.fsym_id)
Planning time : 28.285 ms
Execution time : 3,056.773 ms