为啥同一条sql 只是查询条件IN 多了一个 查询性能相差特别大,见图描述



对比两个查询 ,只是 mn.mp_id IN () 少了一个ID 1815578536521687042,性能差距巨大,
这是为甚么呢?
为啥act Rows 一个704,一个没有1815578536521687042 actRows 423168这么大
补充:mp_news表大小为 45w。

我把数据同步到mysql上执行,并不存在这个问题,mysql 上执行计划是一样的,都是2、3ms

我个人观点是:猜测是影响了索引的连续性,增加的mp_id可能使得数据更集中,可能让优化器选择了更有效执行路径,减少了分布式环境下的数据访问开销,导致了显著的性能提升。

你实际查一下mp_id是1815578536521687042这个的有多少条数据?

15w多

那慢点不是正常的,可能你统计信息不是非常新,但是也差不多吧。。。可以analyze table 然后再看下执行计划。。。。

判断是1820745448125562882这mp_id导致的 ,IN里面有这个mp_id 就会几百ms ,没有就是 几ms 。但是1820745448125562882这个ID 数据大概是3w多
image
mp_id是1815578536521687042有 16w
image

analyze table 试过了几次了 ,没用
执行计划也并没有出现stats:pseudo

一个只要2ms,一个300多ms 这不是差一点吧,差了上百倍哦

带上前面的二个条件看一下1820745448125562882有多少条数据

3w多,加条件不加条件相差不大 ,看下图
image

猜测表的 id 列为主键,并且为聚簇表,请提供表结构

如果上边没错的话,建议在(mp_id,send_time)列上建立复合索引,这样这个 SQL 就不会性能差距那么大了

(mp_id,send_time)索引也试过了的,效果并没有走send_time索引好,表结构如下

请提供走这个索引的执行计划,需要 explain analyze 的文本结果,可以使用代码块发上来,像这样

11111111

使用 show create table 获取一下表结构,这种看不到是不是聚簇表

CREATE TABLE mp_news (
id bigint(20) NOT NULL COMMENT ‘ID’,
mp_id bigint(20) NOT NULL COMMENT ‘公众号ID’,
source_id bigint(20) DEFAULT NULL COMMENT ‘转发消息类型的主键id,自建类型该字段为null’,
title varchar(500) NOT NULL COMMENT ‘标题’,
content mediumtext NOT NULL COMMENT ‘富文本内容’,
waterfall_flow_url varchar(128) DEFAULT NULL COMMENT ‘瀑布流图片地址’,
template_url varchar(128) DEFAULT NULL COMMENT ‘模板图片地址’,
screen_url varchar(500) DEFAULT NULL COMMENT ‘视频封面’,
direct_news_url varchar(256) DEFAULT NULL COMMENT ‘消息直达链接’,
media_id text COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT ‘消息所使用的媒体id’,
news_type tinyint(4) NOT NULL DEFAULT ‘0’ COMMENT ‘消息类型,0自建 1推特 2tg 3其他新闻 4巨鲸’,
quote_news_id bigint(20) DEFAULT NULL COMMENT ‘转发类型时,引用/转发的消息id’,
is_push tinyint(4) DEFAULT ‘0’ COMMENT ‘是否推送(0 否 1是)’,
send_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘消息发送时间’,
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间’,
update_time datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘更新时间’,
is_delete tinyint(4) DEFAULT ‘0’ COMMENT ‘是否删除(0 否 1是)’,
read_num int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘阅读次数’,
total_read_time int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘总阅读时间,单位为秒’,
share_num int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘分享次数’,
like_num int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘点赞次数’,
collect_num int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘收藏次数’,
comment_num int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘评论次数’,
score decimal(10,2) NOT NULL DEFAULT ‘0.60’ COMMENT ‘推荐分数’,
translation_content varchar(255) DEFAULT NULL,
translation_title varchar(255) DEFAULT NULL,
PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */,
KEY idx_mp_id (mp_id),
KEY idx_send_time (send_time),
KEY idx_mp_id_send_time (mp_id,send_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT=‘公众号消息主体表’

sql-1:
EXPLAIN ANALYZE
SELECT
mn.id,
mn.title,
IF(
mn.template_url IS NOT NULL,
mn.template_url,
mn.screen_url
) AS cover,
mn.send_time,
mn.create_time,
mn.media_id,
mn.content,
mn.news_type,
mn.like_num,
mn.collect_num,
mn.read_num,
mn.comment_num,
mn.mp_id
FROM
mp_news mn
WHERE
mn.is_delete = 0
AND mn.is_push = 1
AND mn.mp_id IN (
1815582786249474049,
1820745448125562882,
1823174000712032257
)
ORDER BY
mn.send_time DESC,
mn.id DESC
LIMIT
10;
执行分析计划结果如下:
{
“EXPLAIN ANALYZE\r\nSELECT\r\n mn.id,\r\n mn.title,\r\n IF(\r\n mn.template_url IS NOT NULL,\r\n mn.template_url,\r\n mn.screen_url\r\n ) AS cover,\r\n mn.send_time,\r\n mn.create_time,\r\n mn.media_id,\r\n mn.content,\r\n mn.news_type,\r\n mn.like_num,\r\n mn.collect_num,\r\n mn.read_num,\r\n mn.comment_num,\r\n mn.mp_id\r\nFROM\r\n mp_news mn\r\nWHERE\r\n mn.is_delete = 0\r\n AND mn.is_push = 1\r\n AND mn.mp_id IN (\r\n 1815582786249474049,\r\n 1820745448125562882,\r\n 1823174000712032257\r\n )\r\nORDER BY\r\n mn.send_time DESC,\r\n mn.id DESC\r\nLIMIT\r\n 10”: [
{
“id” : “Projection_7”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:311.8ms, loops:2, RU:2980.925680, Concurrency:OFF”,
“operator info” : “liu_test.mp_news.id, liu_test.mp_news.title, if(not(isnull(liu_test.mp_news.template_url)), liu_test.mp_news.template_url, liu_test.mp_news.screen_url)->Column#27, liu_test.mp_news.send_time, liu_test.mp_news.create_time, liu_test.mp_news.media_id, liu_test.mp_news.content, liu_test.mp_news.news_type, liu_test.mp_news.like_num, liu_test.mp_news.collect_num, liu_test.mp_news.read_num, liu_test.mp_news.comment_num, liu_test.mp_news.mp_id”,
“memory” : “19.8 KB”,
“disk” : “N/A”
},
{
“id” : “└─Limit_12”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:311.8ms, loops:2”,
“operator info” : “offset:0, count:10”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─IndexLookUp_25",
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:311.8ms, loops:1, index_task: {total_time: 311.7ms, fetch_handle: 41.5ms, build: 42.2ms, wait: 228.1ms}, table_task: {total_time: 2.36s, num: 28, concurrency: 8}, next: {wait_index: 1.37ms, wait_table_lookup_build: 36.8µs, wait_table_lookup_resp: 310.3ms}”,
“operator info” : “”,
“memory” : “49.0 MB”,
“disk” : “N/A”
},
{
“id” : " ├─IndexFullScan_22(Build)“,
“estRows” : “174.31”,
“actRows” : “423168”,
“task” : “cop[tikv]”,
“access object” : “table:mn, index:idx_send_time(send_time)”,
“execution info” : “time:24.5ms, loops:390, cop_task: {num: 17, max: 28.2ms, min: 216.5µs, avg: 2.15ms, p95: 28.2ms, max_proc_keys: 50144, p95_proc_keys: 50144, tot_proc: 30ms, tot_wait: 1.48ms, copr_cache_hit_ratio: 0.65, build_task_duration: 32µs, max_distsql_concurrency: 2}, rpc_info:{Cop:{num_rpc:17, total_time:36.4ms}}, tikv_task:{proc max:49ms, min:0s, avg: 16.8ms, p80:31ms, p95:49ms, iters:477, tasks:17}, scan_detail: {total_process_keys: 53856, total_process_keys_size: 2477376, total_keys: 53862, get_snapshot_time: 1.05ms, rocksdb: {key_skipped_count: 53861, block: {cache_hit_count: 99}}}, time_detail: {total_process_time: 30ms, total_suspend_time: 66.2µs, total_wait_time: 1.48ms, total_kv_read_wall_time: 29ms, tikv_wall_time: 32.9ms}”,
“operator info” : “keep order:true, desc”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─Selection_24(Probe)”,
“estRows” : “10.00”,
“actRows” : “14839”,
“task” : “cop[tikv]”,
“access object” : “”,
“execution info” : “time:2.26s, loops:49, cop_task: {num: 39, max: 264.4ms, min: 0s, avg: 51.4ms, p95: 242.4ms, max_proc_keys: 20479, p95_proc_keys: 20473, tot_proc: 1.62s, tot_wait: 4.61ms, copr_cache_hit_ratio: 0.05, build_task_duration: 4.3ms, max_distsql_concurrency: 2, max_extra_concurrency: 1}, rpc_info:{Cop:{num_rpc:39, total_time:2.14s}, rpc_errors:{context canceled:4}}, tikv_task:{proc max:254ms, min:0s, avg: 53.2ms, p80:152ms, p95:232ms, iters:306, tasks:35}, scan_detail: {total_process_keys: 188513, total_process_keys_size: 154794211, total_keys: 206704, get_snapshot_time: 3.67ms, rocksdb: {key_skipped_count: 213195, block: {cache_hit_count: 388324}}}, time_detail: {total_process_time: 1.62s, total_suspend_time: 263.3ms, total_wait_time: 4.61ms, total_kv_read_wall_time: 1.82s, tikv_wall_time: 1.95s}”,
“operator info” : “eq(liu_test.mp_news.is_delete, 0), eq(liu_test.mp_news.is_push, 1), in(liu_test.mp_news.mp_id, 1815582786249474049, 1820745448125562882, 1823174000712032257)”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─TableRowIDScan_23",
“estRows” : “174.31”,
“actRows” : “190504”,
“task” : “cop[tikv]”,
“access object” : “table:mn”,
“execution info” : “tikv_task:{proc max:251ms, min:0s, avg: 52.5ms, p80:150ms, p95:230ms, iters:306, tasks:35}”,
“operator info” : “keep order:false”,
“memory” : “N/A”,
“disk” : “N/A”
}
]}

sql-2:
EXPLAIN ANALYZE
SELECT
mn.id,
mn.title,
IF(
mn.template_url IS NOT NULL,
mn.template_url,
mn.screen_url
) AS cover,
mn.send_time,
mn.create_time,
mn.media_id,
mn.content,
mn.news_type,
mn.like_num,
mn.collect_num,
mn.read_num,
mn.comment_num,
mn.mp_id
FROM
mp_news mn
WHERE
mn.is_delete = 0
AND mn.is_push = 1
AND mn.mp_id IN (
1815578536521687042,
1815582786249474049,
1820745448125562882,
1823174000712032257
)
ORDER BY
mn.send_time DESC,
mn.id DESC
LIMIT
10;
执行分析计划结果如下:
{
“EXPLAIN ANALYZE\r\nSELECT\r\n mn.id,\r\n mn.title,\r\n IF(\r\n mn.template_url IS NOT NULL,\r\n mn.template_url,\r\n mn.screen_url\r\n ) AS cover,\r\n mn.send_time,\r\n mn.create_time,\r\n mn.media_id,\r\n mn.content,\r\n mn.news_type,\r\n mn.like_num,\r\n mn.collect_num,\r\n mn.read_num,\r\n mn.comment_num,\r\n mn.mp_id\r\nFROM\r\n mp_news mn\r\nWHERE\r\n mn.is_delete = 0\r\n AND mn.is_push = 1\r\n AND mn.mp_id IN (\r\n 1815578536521687042,\r\n 1815582786249474049,\r\n 1820745448125562882,\r\n 1823174000712032257\r\n )\r\nORDER BY\r\n mn.send_time DESC,\r\n mn.id DESC\r\nLIMIT\r\n 10”: [
{
“id” : “Projection_7”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:2.72ms, loops:2, RU:5.928749, Concurrency:OFF”,
“operator info” : “liu_test.mp_news.id, liu_test.mp_news.title, if(not(isnull(liu_test.mp_news.template_url)), liu_test.mp_news.template_url, liu_test.mp_news.screen_url)->Column#27, liu_test.mp_news.send_time, liu_test.mp_news.create_time, liu_test.mp_news.media_id, liu_test.mp_news.content, liu_test.mp_news.news_type, liu_test.mp_news.like_num, liu_test.mp_news.collect_num, liu_test.mp_news.read_num, liu_test.mp_news.comment_num, liu_test.mp_news.mp_id”,
“memory” : “13.9 KB”,
“disk” : “N/A”
},
{
“id” : “└─Limit_12”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:2.7ms, loops:2”,
“operator info” : “offset:0, count:10”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─IndexLookUp_25",
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:2.69ms, loops:1, index_task: {total_time: 2.17ms, fetch_handle: 2ms, build: 141.4µs, wait: 21.8µs}, table_task: {total_time: 5.75ms, num: 5, concurrency: 8}, next: {wait_index: 1.29ms, wait_table_lookup_build: 49.5µs, wait_table_lookup_resp: 1.32ms}”,
“operator info” : “”,
“memory” : “125.0 KB”,
“disk” : “N/A”
},
{
“id” : " ├─IndexFullScan_22(Build)“,
“estRows” : “29.50”,
“actRows” : “704”,
“task” : “cop[tikv]”,
“access object” : “table:mn, index:idx_send_time(send_time)”,
“execution info” : “time:2.4ms, loops:7, cop_task: {num: 3, max: 1.02ms, min: 865.3µs, avg: 926.1µs, p95: 1.02ms, max_proc_keys: 480, p95_proc_keys: 480, tot_proc: 832.2µs, tot_wait: 792.3µs, copr_cache_hit_ratio: 0.00, build_task_duration: 35.8µs, max_distsql_concurrency: 2}, rpc_info:{Cop:{num_rpc:3, total_time:2.72ms}}, tikv_task:{proc max:0s, min:0s, avg: 0s, p80:0s, p95:0s, iters:8, tasks:3}, scan_detail: {total_process_keys: 704, total_process_keys_size: 32384, total_keys: 707, get_snapshot_time: 683.3µs, rocksdb: {key_skipped_count: 706, block: {cache_hit_count: 13}}}, time_detail: {total_process_time: 832.2µs, total_wait_time: 792.3µs, tikv_wall_time: 2ms}”,
“operator info” : “keep order:true, desc”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─Selection_24(Probe)”,
“estRows” : “10.00”,
“actRows” : “15”,
“task” : “cop[tikv]”,
“access object” : “”,
“execution info” : “time:4.76ms, loops:6, cop_task: {num: 2, max: 1.2ms, min: 0s, avg: 598.9µs, p95: 1.2ms, max_proc_keys: 32, p95_proc_keys: 32, tot_proc: 744.2µs, tot_wait: 44.5µs, copr_cache_hit_ratio: 0.00, build_task_duration: 66.8µs, max_distsql_concurrency: 1, max_extra_concurrency: 1}, rpc_info:{Cop:{num_rpc:2, total_time:2.49ms}, rpc_errors:{context canceled:1}}, tikv_task:{time:1ms, loops:2}, scan_detail: {total_process_keys: 32, total_process_keys_size: 41559, total_keys: 34, get_snapshot_time: 21.4µs, rocksdb: {key_skipped_count: 22, block: {cache_hit_count: 73}}}, time_detail: {total_process_time: 744.2µs, total_wait_time: 44.5µs, total_kv_read_wall_time: 1ms, tikv_wall_time: 996.8µs}”,
“operator info” : “eq(liu_test.mp_news.is_delete, 0), eq(liu_test.mp_news.is_push, 1), in(liu_test.mp_news.mp_id, 1815578536521687042, 1815582786249474049, 1820745448125562882, 1823174000712032257)”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─TableRowIDScan_23",
“estRows” : “29.50”,
“actRows” : “32”,
“task” : “cop[tikv]”,
“access object” : “table:mn”,
“execution info” : “tikv_task:{time:1ms, loops:2}”,
“operator info” : “keep order:false”,
“memory” : “N/A”,
“disk” : “N/A”
}
]}

发下走这个索引的执行计划,格式麻烦发成文本的执行计划格式,看起来正常的格式

这个是聚簇表,但是我试过(mp_id,send_time) 建立索引 效果并不是很好啊

请把执行计划发上来,不好也看下不好的原因,谢谢

{
“EXPLAIN ANALYZE\r\nSELECT\r\n mn.id,\r\n mn.title,\r\n IF(\r\n mn.template_url IS NOT NULL,\r\n mn.template_url,\r\n mn.screen_url\r\n ) AS cover,\r\n mn.send_time,\r\n mn.create_time,\r\n mn.media_id,\r\n mn.content,\r\n mn.news_type,\r\n mn.like_num,\r\n mn.collect_num,\r\n mn.read_num,\r\n mn.comment_num,\r\n mn.mp_id\r\nFROM\r\n mp_news mn force INDEX (idx_mp_id_send_time)\r\nWHERE\r\n mn.is_delete = 0\r\n AND mn.is_push = 1\r\n AND mn.mp_id IN (\r\n 1815582786249474049,\r\n 1820745448125562882,\r\n 1823174000712032257\r\n )\r\nORDER BY\r\n mn.send_time DESC,\r\n mn.id DESC\r\nLIMIT\r\n 10”: [
{
“id” : “Projection_7”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:60.7ms, loops:2, RU:507.953991, Concurrency:OFF”,
“operator info” : “liu_test.mp_news.id, liu_test.mp_news.title, if(not(isnull(liu_test.mp_news.template_url)), liu_test.mp_news.template_url, liu_test.mp_news.screen_url)->Column#27, liu_test.mp_news.send_time, liu_test.mp_news.create_time, liu_test.mp_news.media_id, liu_test.mp_news.content, liu_test.mp_news.news_type, liu_test.mp_news.like_num, liu_test.mp_news.collect_num, liu_test.mp_news.read_num, liu_test.mp_news.comment_num, liu_test.mp_news.mp_id”,
“memory” : “19.8 KB”,
“disk” : “N/A”
},
{
“id” : “└─TopN_9”,
“estRows” : “10.00”,
“actRows” : “10”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:60.7ms, loops:2”,
“operator info” : “liu_test.mp_news.send_time:desc, liu_test.mp_news.id:desc, offset:0, count:10”,
“memory” : “63.3 KB”,
“disk” : “N/A”
},
{
“id” : " └─IndexLookUp_17",
“estRows” : “10.00”,
“actRows” : “183”,
“task” : “root”,
“access object” : “”,
“execution info” : “time:60.5ms, loops:3, index_task: {total_time: 6.43ms, fetch_handle: 6.4ms, build: 6.82µs, wait: 19.5µs}, table_task: {total_time: 136.8ms, num: 12, concurrency: 8}, next: {wait_index: 931.6µs, wait_table_lookup_build: 108µs, wait_table_lookup_resp: 59.2ms}”,
“operator info” : “”,
“memory” : “1.92 MB”,
“disk” : “N/A”
},
{
“id” : " ├─IndexRangeScan_13(Build)“,
“estRows” : “32254.00”,
“actRows” : “32281”,
“task” : “cop[tikv]”,
“access object” : “table:mn, index:idx_mp_id_send_time(mp_id, send_time)”,
“execution info” : “time:4.72ms, loops:42, cop_task: {num: 8, max: 1.85ms, min: 273.7µs, avg: 679.2µs, p95: 1.85ms, max_proc_keys: 3040, p95_proc_keys: 3040, tot_proc: 2.63ms, tot_wait: 361.6µs, copr_cache_hit_ratio: 0.50, build_task_duration: 29.1µs, max_distsql_concurrency: 1}, rpc_info:{Cop:{num_rpc:8, total_time:5.34ms}}, tikv_task:{proc max:10ms, min:0s, avg: 2.5ms, p80:5ms, p95:10ms, iters:63, tasks:8}, scan_detail: {total_process_keys: 4736, total_process_keys_size: 260480, total_keys: 4741, get_snapshot_time: 174.4µs, rocksdb: {key_skipped_count: 4736, block: {cache_hit_count: 21}}}, time_detail: {total_process_time: 2.63ms, total_suspend_time: 12.6µs, total_wait_time: 361.6µs, total_kv_read_wall_time: 2ms, tikv_wall_time: 3.73ms}”,
“operator info” : “range:[1815582786249474049,1815582786249474049], [1820745448125562882,1820745448125562882], [1823174000712032257,1823174000712032257], keep order:false”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─TopN_16(Probe)”,
“estRows” : “10.00”,
“actRows” : “183”,
“task” : “cop[tikv]”,
“access object” : “”,
“execution info” : “time:129ms, loops:24, cop_task: {num: 23, max: 53ms, min: 0s, avg: 9.19ms, p95: 39.6ms, max_proc_keys: 6565, p95_proc_keys: 4603, tot_proc: 193.9ms, tot_wait: 1.01ms, copr_cache_hit_ratio: 0.12, build_task_duration: 390.5µs, max_distsql_concurrency: 3, max_extra_concurrency: 1, store_batch_num: 3}, rpc_info:{Cop:{num_rpc:20, total_time:211.1ms}}, tikv_task:{proc max:51ms, min:0s, avg: 10.4ms, p80:20ms, p95:38ms, iters:49, tasks:23}, scan_detail: {total_process_keys: 23811, total_process_keys_size: 27897135, total_keys: 26221, get_snapshot_time: 460.3µs, rocksdb: {key_skipped_count: 39396, block: {cache_hit_count: 25739}}}, time_detail: {total_process_time: 193.9ms, total_suspend_time: 4.22ms, total_wait_time: 1.01ms, total_kv_read_wall_time: 182ms, tikv_wall_time: 204.4ms}”,
“operator info” : “liu_test.mp_news.send_time:desc, liu_test.mp_news.id:desc, offset:0, count:10”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─Selection_15",
“estRows” : “26087.86”,
“actRows” : “32254”,
“task” : “cop[tikv]”,
“access object” : “”,
“execution info” : “tikv_task:{proc max:49ms, min:0s, avg: 10.2ms, p80:20ms, p95:38ms, iters:49, tasks:23}”,
“operator info” : “eq(liu_test.mp_news.is_delete, 0), eq(liu_test.mp_news.is_push, 1)”,
“memory” : “N/A”,
“disk” : “N/A”
},
{
“id” : " └─TableRowIDScan_14",
“estRows” : “32254.00”,
“actRows” : “32281”,
“task” : “cop[tikv]”,
“access object” : “table:mn”,
“execution info” : “tikv_task:{proc max:49ms, min:0s, avg: 10ms, p80:19ms, p95:38ms, iters:49, tasks:23}”,
“operator info” : “keep order:false”,
“memory” : “N/A”,
“disk” : “N/A”
}
]}
要几十毫秒 ,可能是因为我觉得 那个走send_time 大部分查询都是几ms 才觉得 这个效果不好吧

看到执行计划我知道为啥慢了,因为走不到 limit 算子,走到了 top 算子
试下 (send_time,id,mp_id) 这三个列索引,发下执行计划