草庐IT

0.500000

全部标签

mysql - 偏移量为 ("LIMIT 500000, 10"的限制)即使在索引之后也很慢?

我有一个包含int字段的表,我们称它为createTime。该表由几百万条记录组成。现在我想运行查询:select*from`table`orderby`createTime`desclimit500000,10我已经为createTime创建了一个索引,但是查询运行得非常慢。什么原因?我该如何改进它?EXPLAIN的内容如下:id1select_typesimpletabletabletypeindexpossible_keysnullkeycreateTimekey_len4refnullrows500010extra至于偏移量,它在较小时工作得更快。