我們有4 sphinx索引建立使用來自一個表的數據。所有索引都具有相同的源設置,只是它們採用不同的文檔。我們有像這樣的檢查mod(id, 4) = <index number>
在索引之間分發文檔和文檔屬性。重建獅身人面像索引失敗
問題:四個索引之一(同一個)幾乎每次重建索引都無法重建。其他索引從來沒有這個問題,並正確重建。
我們已經對文檔和屬性表進行了分區。例如,這是文件表如何分區:
PARTITION BY HASH(mod(id, 4))(
PARTITION `p0` COMMENT '',
PARTITION `p1` COMMENT '',
PARTITION `p2` COMMENT '',
PARTITION `p3` COMMENT ''
);
我們認爲它已經收到所有文件之後索引掛起,但它開始接收屬性之前。當我們檢查MySQL服務器上的會話時我們可以看到這一點。
無法重建的索引使用mod(id, 4) = 0
條件。
我們在Ubuntu 64bit 12.04.02 LTS上使用Sphinx 2.0.4版本。
數據源配置
source ble_job_2 : ble_job
{
sql_query = select job_notice.id as id, \
body, title, source, company, \
UNIX_TIMESTAMP(insertDate) as date, \
substring(company, 1, 1) as companyletter, \
job_notice.locationCountry as country, \
location_us_state.stateName as state, \
0 as expired, \
clusterId, \
groupCity, \
groupCityAttr, \
job_notice.cityLat as citylat, \
job_notice.cityLng as citylng, \
job_notice.zipLat as ziplat, \
job_notice.zipLng as ziplng, \
feedId, job_notice.rating as rating, \
job_notice.cityId as cityid \
from job_notice \
left join location_us_state on job_notice.locationState = location_us_state.stateCode \
where job_notice.status != 'expired' \
and mod(job_notice.id, 4) = 1
sql_attr_multi = uint attr from query; \
select noticeId, attributeId as attr from job_notice_attribute where mod(noticeId, 4) = 1
} # source ble_job_2
指數配置
index ble_job_2
{
type = plain
source = ble_job_2
path = /var/lib/sphinxsearch/data/ble_job_2
docinfo = extern
mlock = 0
morphology = none
stopwords = /etc/sphinxsearch/stopwords/blockwords.txt
min_word_len = 1
charset_type = utf-8
enable_star = 0
html_strip = 0
} # index_ble_job_2
任何幫助將不勝感激。
致以誠摯的問候。
你如何定義你的sql_query這些索引?我以爲用分區引擎,你不能直接訪問底層表,只有組合表。 – barryhunter 2013-03-11 13:16:03
我把我們的配置放在這裏。我不能直接訪問底層表,但我認爲當我檢查'mod(id,4)= 0'時,它訪問底層分區。我認爲這是因爲我可以看到添加分區時的性能改進。 – 2013-03-11 13:48:43
@barryhunter感謝您的幫助。對於「Sphinx MVA中的錯誤查詢」問題,您的其他答案對我們有很大幫助,因爲我們首先嚐試將範圍應用於sql_attr_multi查詢。 – 2013-03-11 14:33:04