表中的列:user_id
和season_id
这是更快:Rails /索引性能Q - 哪个更快?
#If I have a database index on user_id
Table.find_all_by_user_id(some_id)
或
#If I have a database index on user_id and season_id
Table.find_all_by_user_id_and_season_id(some_id, another_id)
是一个多列索引总是快?
例如,写多列索引较慢?如果是这样,我可以使用单列查询。
PS。该表有大约1,000,000条记录,并且稳步增长!
你误会了我:)看看我的编辑。 – Frexuz 2010-10-17 16:33:59