【发布时间】:2013-01-24 22:42:30
【问题描述】:
我正在使用 Thinking Sphinx 为包含 43,000 条记录的单个表建立索引。当我尝试对其进行索引时,该过程运行非常缓慢并在 36,000 后冻结。
我认为数据有问题,并试图找出导致问题的索引。删除除 11 个索引之外的所有索引后,我仍然始终看到错误。但问题是:似乎没有一个单一的索引是罪魁祸首。如果我删除最后 11 个中的任何一个,则该过程将在不冻结的情况下完成。如果我把它加回来,问题又回来了。 (虽然我注意到当我删除其中一个索引时,该过程仍然会减慢很多,达到 39,000。)
所以现在我被难住了。我有足够的内存和磁盘空间,所以这不是问题。我将 sql_range_step 设置为 15000,将 mem_limit 设置为 2047M。没有任何帮助。
这是我精简的索引列表:
define_index do
indexes :email
has :id, :as => :code
has :premium_school_id
has :current_employer_account_id
has :years_experience_id
has :user_status_id
has practice_areas(:id), :as => :practice_area_ids
has languages(:id), :as => :language_ids
has preferred_employer_types(:id), :as => :preferred_employer_type_ids
has geographical_regions(:id), :as => :geographical_region_ids
has workflow_events(:id), :as => :workflow_event_ids
end
欢迎提出任何想法。
【问题讨论】:
标签: ruby-on-rails sphinx thinking-sphinx