[groonga-dev,04449] indexを使ったin_valuesでの不具合

Back to archive index

murata satoshi murat****@gmail*****
2017年 8月 25日 (金) 21:55:04 JST


むらたです。お世話になっております。
indexを使ったin_valuesで不具合を見つけましたので報告させていただきます。

■ 現象
indexを使ったin_values(target, value1, ..., valueN)でvalueNの数が増えると正しい結果を取得できない。
(具体的には126件までしか持ってこれない)

■ 環境
Amazon Linux(AMI 2017.03.1)
groonga:7.0.5

■ 再現手順
*mroongaから作成/更新している環境で発覚しましたが、groonga単体でも起こるのでgroonga単体で。
*長くなってすみません。。

groonga -n /tmp/test.db
>table_create --name test_table --flags TABLE_PAT_KEY --key_type UInt32
>column_create --table test_table --name id --flags COLUMN_SCALAR --type UInt32
>table_create --name test_table_index --flags TABLE_PAT_KEY --key_type UInt32
>column_create --table test_table_index --name id --flags COLUMN_INDEX --type test_table --source id

**別件ですが、schema打った時に、indexカラム作成のcommandが[--sources]になってますね。。
> schema --output_pretty yes
...
"command_line": "column_create --table test_table_index --name id --flags COLUMN_INDEX --type test_table --sources id"
...

>load --table test_table
[
{"_key": 1, "id": 1},
{"_key": 2, "id": 2},
{"_key": 3, "id": 3},
{"_key": 4, "id": 4},
{"_key": 5, "id": 5},
{"_key": 6, "id": 6},
{"_key": 7, "id": 7},
{"_key": 8, "id": 8},
{"_key": 9, "id": 9},
{"_key": 10, "id": 10},
{"_key": 11, "id": 11},
{"_key": 12, "id": 12},
{"_key": 13, "id": 13},
{"_key": 14, "id": 14},
{"_key": 15, "id": 15},
{"_key": 16, "id": 16},
{"_key": 17, "id": 17},
{"_key": 18, "id": 18},
{"_key": 19, "id": 19},
{"_key": 20, "id": 20},
{"_key": 21, "id": 21},
{"_key": 22, "id": 22},
{"_key": 23, "id": 23},
{"_key": 24, "id": 24},
{"_key": 25, "id": 25},
{"_key": 26, "id": 26},
{"_key": 27, "id": 27},
{"_key": 28, "id": 28},
{"_key": 29, "id": 29},
{"_key": 30, "id": 30},
{"_key": 31, "id": 31},
{"_key": 32, "id": 32},
{"_key": 33, "id": 33},
{"_key": 34, "id": 34},
{"_key": 35, "id": 35},
{"_key": 36, "id": 36},
{"_key": 37, "id": 37},
{"_key": 38, "id": 38},
{"_key": 39, "id": 39},
{"_key": 40, "id": 40},
{"_key": 41, "id": 41},
{"_key": 42, "id": 42},
{"_key": 43, "id": 43},
{"_key": 44, "id": 44},
{"_key": 45, "id": 45},
{"_key": 46, "id": 46},
{"_key": 47, "id": 47},
{"_key": 48, "id": 48},
{"_key": 49, "id": 49},
{"_key": 50, "id": 50},
{"_key": 51, "id": 51},
{"_key": 52, "id": 52},
{"_key": 53, "id": 53},
{"_key": 54, "id": 54},
{"_key": 55, "id": 55},
{"_key": 56, "id": 56},
{"_key": 57, "id": 57},
{"_key": 58, "id": 58},
{"_key": 59, "id": 59},
{"_key": 60, "id": 60},
{"_key": 61, "id": 61},
{"_key": 62, "id": 62},
{"_key": 63, "id": 63},
{"_key": 64, "id": 64},
{"_key": 65, "id": 65},
{"_key": 66, "id": 66},
{"_key": 67, "id": 67},
{"_key": 68, "id": 68},
{"_key": 69, "id": 69},
{"_key": 70, "id": 70},
{"_key": 71, "id": 71},
{"_key": 72, "id": 72},
{"_key": 73, "id": 73},
{"_key": 74, "id": 74},
{"_key": 75, "id": 75},
{"_key": 76, "id": 76},
{"_key": 77, "id": 77},
{"_key": 78, "id": 78},
{"_key": 79, "id": 79},
{"_key": 80, "id": 80},
{"_key": 81, "id": 81},
{"_key": 82, "id": 82},
{"_key": 83, "id": 83},
{"_key": 84, "id": 84},
{"_key": 85, "id": 85},
{"_key": 86, "id": 86},
{"_key": 87, "id": 87},
{"_key": 88, "id": 88},
{"_key": 89, "id": 89},
{"_key": 90, "id": 90},
{"_key": 91, "id": 91},
{"_key": 92, "id": 92},
{"_key": 93, "id": 93},
{"_key": 94, "id": 94},
{"_key": 95, "id": 95},
{"_key": 96, "id": 96},
{"_key": 97, "id": 97},
{"_key": 98, "id": 98},
{"_key": 99, "id": 99},
{"_key": 100, "id": 100},
{"_key": 101, "id": 101},
{"_key": 102, "id": 102},
{"_key": 103, "id": 103},
{"_key": 104, "id": 104},
{"_key": 105, "id": 105},
{"_key": 106, "id": 106},
{"_key": 107, "id": 107},
{"_key": 108, "id": 108},
{"_key": 109, "id": 109},
{"_key": 110, "id": 110},
{"_key": 111, "id": 111},
{"_key": 112, "id": 112},
{"_key": 113, "id": 113},
{"_key": 114, "id": 114},
{"_key": 115, "id": 115},
{"_key": 116, "id": 116},
{"_key": 117, "id": 117},
{"_key": 118, "id": 118},
{"_key": 119, "id": 119},
{"_key": 120, "id": 120},
{"_key": 121, "id": 121},
{"_key": 122, "id": 122},
{"_key": 123, "id": 123},
{"_key": 124, "id": 124},
{"_key": 125, "id": 125},
{"_key": 126, "id": 126},
{"_key": 127, "id": 127},
{"_key": 128, "id": 128},
{"_key": 129, "id": 129},
{"_key": 130, "id": 130}
]

>select test_table --filter 'in_values(id,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128)' --cache no
[[0,1503663680.514779,0.02670073509216309],[[[126],[["_id","UInt32"],["_key","UInt32"],["id","UInt32"]],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5],[6,6,6],[7,7,7],[8,8,8],[9,9,9],[10,10,10]]]]

...126件までしか持ってこれないようです。これ以上多くしても一律で126件になります。

ログへは以下が出力されていました(level:DEBUG)
[table][select][index][selector][in_values] <test_table_index.id>
[object][search][index][key][exact] <test_table_index.id>
grn_ii_sel > ()
n=1 ()
exact: 1
hits=1
...以下126まで続く。
(それ以外のエラー等は出力されていません。)
****
idにindex作らない場合は以下でした。(no-indexなので件数多くなると遅いです。結果は正しい)
[table][select][index][selector][no-index][in_values] <test_table>
--
idではなく_keyでやった場合は以下でした。(件数多くなると遅いです。結果は正しい)
[table][select][index][selector][in_values] <>
--
in_values()ではなく、id==1||id==2...(或いは_key==1||_key==2...)では以下。
(正しい結果が取得でき速度的にも問題ありません。)
[table][select][index][equal] <test_table_index.id>
[table][select][index][equal][accessor][key] <test_table>
--

以上、よろしくお願いします。

むらた(murat****@gmail*****)



groonga-dev メーリングリストの案内
Back to archive index