下面两个语句
sql> SELECT * FROM ***.trade_record ORDER BY id LIMIT 10 OFFSET 999999
[2017-04-11 11:16:34] 10 rows retrieved starting from 1 in 341ms (execution: 318ms, fetching: 23ms)
sql> SELECT id FROM ***.trade_record ORDER BY id LIMIT 1 OFFSET 999999
[2017-04-11 11:16:56] 1 row retrieved starting from 1 in 7s 691ms (execution: 7s 688ms, fetching: 3ms)
请问为啥查询数量少,字段少的 反而消耗的时间多呢
execution: 执行
fetching: 获取么?..
为啥差距这么大呢
1
sagaxu 2017-04-11 11:31:20 +08:00
EXPLAIN 看一下查询计划
|
2
prasanta 2017-04-11 12:45:48 +08:00
我也比较关心这个问题
|