[groonga-dev,04534] Re: JSONB や 配列フィールドについての pgroonga インデックス作成時間および、jsonb のフェッチについて

Back to archive index

内山敏郎 toshio_uchiy****@mirro*****
2017年 11月 23日 (木) 19:57:10 JST


MLの皆様、お世話になります。
内山です。

 追加情報です。

create index pgroonga_subtitled on subtitled using pgroonga( content );

を実行していたら、

psql:./make_subtitled_index.sql:5: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:./make_subtitled_index.sql:5: connection to server was lost

となって自動アボートされました。この現象は、CentOS 7.4 + PostgreSQL 10.1 +
PGroonga 2.02
FreeBSD 9.2 + PostgreSQL 9.5 + PGroonga 2で起きました。

FreeBSD でインデックスを作っている最中、postgres のプロセスが pfault (デッ
ドロック?)
になっていました。
 アドバイスありましたらよろしくお願いします。

-----Original Message-----
From: groon****@lists*****
[mailto:groon****@lists*****] On Behalf Of 内山敏郎
Sent: Wednesday, November 22, 2017 9:52 AM
To: '全文検索エンジンGroonga開発メーリングリスト'
Subject: [groonga-dev,04533] JSONB や 配列フィールドについての pgroonga イン
デックス作成時間および、jsonb のフェッチについて

MLの皆様
 お世話になります。内山と申します。

〇質問1:インデックス作成時間

create table subtitle ( id bigserial, theme varchar(200), video varchar(25),
content text, track bigint, userid varchar(100), eng_conv smallint,  time
timestamp without time zone, vc bigint, sp smallint );

create index pgroonga_subtitle on subtitle using pgroonga ( content );

content は、おおよそ、1フィールドが 1Kbyte × 100 行 = 100Kbyte 程度
このフィールドを含むレコードが、10万件ほど。このインデックス作成時間が、20分
程度です。

jsonbと配列について、テストしてみました。

create table subtitlec ( id bigserial, theme varchar(200), video
varchar(25), content jsonb, starttime jsonb, track bigint, userid
varchar(100), eng_conv smallint,  time timestamp without time zone, vc
bigint, sp smallint );

create index pgroonga_subtitlec on subtitlec using pgroonga( content );

content はjsonb の配列で、1フィールドの content に、およそ 1Kbyte の要素が
100個入ります。このフィールドを含むレコードが 10万件です。このインデックス
作成時間が 40分程度。

create table subtitled ( id bigserial, theme varchar(200), video
varchar(25),  content text[], starttime numeric(10,3)[], track bigint,
userid varchar[100],  eng_conv smallint, time timestamp without time zone,
vc bigint, sp smallint );

create index pgroonga_subtitled on subtitled using pgroonga( content );

content はtext型の配列で、1フィールドの content に、およそ 1Kbyte の要素が
100個入ります。このフィールドを含むレコードが 10万件です。このインデックス
作成時間が 100分以上かかったため途中でアボートしました。

この測定傾向は、理論的に正しいと考えられれるでしょうか。

〇質問2:検索結果でデータ量の多いjsonb フィールドのフェッチ時間

上記の subtitlec で、content &@ 'アルゴリズム' の検索結果がおよそ1700件
です。この検索結果をフェッチすると45秒かかりました。explain analyze
で時間を測定すると(フェッチしないと)数十ミリ秒です。
加えて、&@~ 'アルゴリズム 検索' として 4件まで絞り込むと
フェッチしても1秒かかりません。

この測定傾向も、理論的に正しいと考えられますでしょうか。

 アドバイスをいただければ幸いです。よろしくお願いします。

_______________________________________________
groonga-dev mailing list
groon****@lists*****
https://lists.osdn.me/mailman/listinfo/groonga-dev




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