提问人:Volatil3 提问时间:10/18/2023 最后编辑:Rick JamesVolatil3 更新时间:10/18/2023 访问量:27
MySQL:添加索引不会提高性能
MySQL: Adding indices is not improving performance
问:
所以我运行了以下内容:
EXPLAIN SELECT i.*
FROM (
SELECT *,
ROW_NUMBER() OVER (PARTITION BY symbol ORDER BY date DESC) AS row_num
FROM indicators_5m
WHERE ema_200 > 0 AND close > ema_200
) AS i
WHERE i.row_num <= 30;
我得到了以下输出:
以下是指数的详细信息:
以下是索引的详细信息:
show index from indicators_5m;
表结构
DESCRIBE indicators_5m;
id int(11) NO PRI NULL auto_increment
symbol varchar(255) YES MUL NULL
open float YES NULL
high float YES NULL
low float YES NULL
close float YES MUL NULL
volume int(11) YES NULL
date datetime YES NULL
rsi float YES NULL
roc float YES NULL
ema_7 float YES NULL
ema_10 float YES NULL
ema_50 float YES 0
ema_100 float YES 0
ema_200 float YES 0
ema_21 float YES NULL
bb_upper float YES NULL
bb_middle float YES NULL
bb_lower float YES NULL
sma_20 float YES NULL
sma_50 float YES NULL
sma_100 float YES NULL
pivot_points float YES 0
resistance_1 float YES 0
support_1 float YES 0
resistance_2 float YES 0
support_2 float YES 0
resistance_3 float YES 0
support_3 float YES 0
macd float YES 0
macd_histogram float YES 0
macd_signal float YES 0
indicators_5m 0 PRIMARY 1 id A 220146 NULL NULL BTREE
indicators_5m 0 unique_symbol_date 1 symbol A 258 NULL NULL YES BTREE
indicators_5m 0 unique_symbol_date 2 date A 220146 NULL NULL YES BTREE
indicators_5m 1 idx_close_emas 1 close A 55036 NULL NULL YES BTREE
indicators_5m 1 idx_close_emas 2 ema_200 A 220146 NULL NULL YES BTREE
indicators_5m 1 idx_close_emas 3 ema_21 A 220146 NULL NULL YES BTREE
答: 暂无答案
评论
SHOW CREATE TABLE