Kouhei Sutou 2019-04-05 14:48:36 +0900 (Fri, 05 Apr 2019) Revision: 101c6aef9fd715f00af234c980bc9ebfd698ca57 https://github.com/groonga/groonga/commit/101c6aef9fd715f00af234c980bc9ebfd698ca57 Message: ii: extend more space for INDEX_LARGE It requires 4x memory than a normal index. Modified files: doc/locale/ja/LC_MESSAGES/reference.po doc/source/reference/commands/column_create.rst lib/grn_ii.h lib/ii.c Modified: doc/locale/ja/LC_MESSAGES/reference.po (+3 -3) =================================================================== --- doc/locale/ja/LC_MESSAGES/reference.po 2019-04-05 14:40:11 +0900 (1edc6f0c4) +++ doc/locale/ja/LC_MESSAGES/reference.po 2019-04-05 14:48:36 +0900 (1d0ce6276) @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.2.1\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-04-03 17:11+0900\n" +"PO-Revision-Date: 2019-04-05 14:48+0900\n" "Last-Translator: Masafumi Yokoyama <yokoy****@clear*****>\n" "Language-Team: Japanese\n" "Language: ja\n" @@ -5216,12 +5216,12 @@ msgstr "大きなインデックスカラムを作成" msgid "" "If you know index target data are large, you need to use large index column. " "It uses increases memory usage for the index column but it can accept more " -"data. Memory usage is 2 times larger than the default index column." +"data. Memory usage is 4 times larger than the default index column." msgstr "" "もし、インデックス対象のデータが大きいことがわかっているなら大きなインデック" "スカラムを使わなければいけません。このインデックスカラムが使用するメモリー量" "が増えますが、より多くのデータを扱えます。デフォルトのインデックスカラムと比" -"べて2倍のメモリー使用量になります。" +"べて4倍のメモリー使用量になります。" msgid "How many data are large? It depends on data." msgstr "どのくらいのデータが大きなデータでしょうか。それはデータによります。" Modified: doc/source/reference/commands/column_create.rst (+1 -1) =================================================================== --- doc/source/reference/commands/column_create.rst 2019-04-05 14:40:11 +0900 (91e38546f) +++ doc/source/reference/commands/column_create.rst 2019-04-05 14:48:36 +0900 (8c03f88b8) @@ -569,7 +569,7 @@ Create a large index column If you know index target data are large, you need to use large index column. It uses increases memory usage for the index column but it can -accept more data. Memory usage is 2 times larger than the default +accept more data. Memory usage is 4 times larger than the default index column. How many data are large? It depends on data. Modified: lib/grn_ii.h (+3 -2) =================================================================== --- lib/grn_ii.h 2019-04-05 14:40:11 +0900 (3004913b7) +++ lib/grn_ii.h 2019-04-05 14:48:36 +0900 (9e69d39c3) @@ -54,6 +54,7 @@ struct _grn_ii { /* BGQ is buffer garbage queue? */ #define GRN_II_BGQSIZE 16 #define GRN_II_MAX_LSEG 0x10000 +#define GRN_II_MAX_LSEG_EXTEND 0x30000 #define GRN_II_W_TOTAL_CHUNK 40 #define GRN_II_W_CHUNK 22 #define GRN_II_W_LEAST_CHUNK (GRN_II_W_TOTAL_CHUNK - 32) @@ -101,8 +102,8 @@ struct _grn_ii_header_normal { struct _grn_ii_header_large { GRN_II_HEADER_COMMON_FIELDS; - uint32_t ainfo_extend[GRN_II_MAX_LSEG]; /* array info (extended) */ - uint32_t binfo_extend[GRN_II_MAX_LSEG]; /* buffer info (extended) */ + uint32_t ainfo_extend[GRN_II_MAX_LSEG_EXTEND]; /* array info (extended) */ + uint32_t binfo_extend[GRN_II_MAX_LSEG_EXTEND]; /* buffer info (extended) */ }; struct _grn_ii_pos { Modified: lib/ii.c (+2 -2) =================================================================== --- lib/ii.c 2019-04-05 14:40:11 +0900 (de2184338) +++ lib/ii.c 2019-04-05 14:48:36 +0900 (249cb100c) @@ -324,7 +324,7 @@ grn_inline static uint32_t grn_ii_n_logical_segments_inline(grn_ii *ii) { if (ii->header.common->flags & GRN_OBJ_INDEX_LARGE) { - return GRN_II_MAX_LSEG * 2; + return GRN_II_MAX_LSEG + GRN_II_MAX_LSEG_EXTEND; } else { return GRN_II_MAX_LSEG; } @@ -5488,7 +5488,7 @@ _grn_ii_create(grn_ctx *ctx, grn_ii *ii, const char *path, grn_obj *lexicon, uin } if (flags & GRN_OBJ_INDEX_LARGE) { grn_ii_header_large *header_large = (grn_ii_header_large *)header; - for (i = 0; i < GRN_II_MAX_LSEG; i++) { + for (i = 0; i < GRN_II_MAX_LSEG_EXTEND; i++) { header_large->ainfo_extend[i] = GRN_II_PSEG_NOT_ASSIGNED; header_large->binfo_extend[i] = GRN_II_PSEG_NOT_ASSIGNED; } -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190405/cad78408/attachment-0001.html>