表中的列: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