我有一张大表格(200'000'000行); 声明如下:
thread( forum_id tinyint, thread_id int,
date_first datetime, date_last datetime
replycount mediumint, extra blob )
论坛 ID 和主题 ID 是主键。对于大型论坛(约一百万个主题),我有时需要运行像 SELECT thread_id FROM thread ORDER BY date_last DESC LIMIT 500000, 10
这样的查询。这些带有巨大偏移量的查询需要一秒钟或者更长时间才能运行。
因此,我想通过复制数据,在拥有最多主题的论坛中创建一些表来加快速度。只有少数几个论坛的主题超过了 100,000 个,因此将会有一个类似于下面的表:
thread_for_forumid_123456 ( thread_id int,
date_first datetime, date_last datetime
replycount mediumint )
你对此有何看法?它是否能加速大型偏移查询?你有其他建议吗?谢谢。