MySQL和NoSQL:帮助我选择正确的
select * from thread where forumid = 100 and replycount > 1 order by dateline desc limit 10000, 100
select * from thread_{forum_id} where replycount > 1 order by dateline desc limit 10000, 100
我该怎么办?在多台机器上继续使用带有分布式数据库的MySQL,还是构建Cassandra集群?
mysql> show index in thread;PRIMARY id forumid dateline replycount
mysql> explain SELECT * FROM thread WHERE forumid = 655 AND visible = 1 AND open <> 10 ORDER BY dateline ASC LIMIT 268000, 250;
+----+-------------+--------+------+---------------+---------+---------+-------------+--------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------+------+---------------+---------+---------+-------------+--------+-----------------------------+
| 1 | SIMPLE | thread | ref | forumid | forumid | 4 | const,const | 221575 | Using where; Using filesort |
+----+-------------+--------+------+---------------+---------+---------+-------------+--------+-----------------------------+
繁华开满天机