我應該怎麼做才能加快獅身人面像索引(使用MySQL)? 我應該使用其他數據庫,noSQL數據庫嗎?獅身人面像重建索引需要幾個小時
請注意,增量索引速度很快,只有完全reindeinx過程很慢。 請詳細解釋。謝謝!
更新: 我重新索引超過10萬項,我的思想,獅身人面像索引定義是這樣的
define_index do
indexes [text, user(:nickname), user(:full_name)]
has rewrites(:id), :as => :rewrite_id
has rewrites(:user_id), :as => :rewrite_user_id
has [rewrites(:user_id), user_id], :as => :user_id_or_rewrites_user_id
has comments(:user_id), :as => :comments_user_id
has simbols(:id), :as => :simbol_ids
has followings(:follower_id), :as => :follower_id
has follows(:followable_id), :as => :followable_id
has created_at, :sortable => true
has rewrites_count, :sortable => true
has relevance, :sortable => true
has user_id
set_property :delta => :datetime
end
請提供一些細節。您索引了多少項目?在哪裏花費大部分時間索引?你有日誌輸出嗎?我已經爲成千上萬篇帶有多個索引字段的文章編制了索引,通常需要幾分鐘的時間。 – Todd 2010-12-18 22:39:40
@Todd:我剛剛更新了我的問題。 – xpepermint 2010-12-18 22:48:36
您是否試圖確定大部分加工過程在哪裏進行?如果它在mysql中,可能需要更好地索引表。也許嘗試手動運行獅身人面像正在使用的查詢,看看它是如何做的。我傾向於說這可以加快。我只是在10k +記錄上重新獲得了一個完整的索引,並且耗時<1分鐘。 – Todd 2010-12-18 23:15:42