[groonga-dev,01533] Re: mroongaラッパーモードにおける行数カウント高速化とorder by limit 高速化について

Back to archive index

kentoku kento****@gmail*****
2013年 7月 11日 (木) 11:51:07 JST


斯波です。

すみません。
こちら、テーブル定義をいただくことはできませんでしょうか?

どうぞ、よろしくお願いします。



2013年7月10日 10:57 HAYASHI Kentaro <hayas****@clear*****>:

>
> 林です。
> お世話になっております。
>
> 詳細な報告ありがとうございます!
>
> ご質問の件1,2それぞれについてはこちらでも確認の上
> 回答させていただければと思います。
>
> 以上、宜しくお願いいたします。
>
> On Tue, 9 Jul 2013 12:52:07 +0900
> Naoya Murakami <visio****@gmail*****> wrote:
>
> > お世話になっております。
> > 村上と申します。
> >
> > 現在、主にmysql5.5.14(spider、VPバンドル版)で
> > mroonga3.05をMyISAMのラッパーモードで利用しています。
> >
> > mariadb10.0.3、mysql5.6.12の性能を試してみたところ、mysql5.6.12のみ、
> > 行数カウントが高速化されていることに気がつきました。
> >
> > 以下のURLを参照すると、ラッパーモードにのみ、行数カウント高速化の項目が
> > ありませんでしたので、ラッパーモードでは、行数カウント高速化が使えないと
> > 認識していました。
> > http://mroonga.org/ja/docs/userguide/storage.html
> > http://mroonga.org/ja/docs/userguide/wrapper.html
> >
> > <質問>
> > 1.mysql5.5、mariadb10のラッパーモードでは、行数カウント高速化が利用できず、
> > mysql5.6では、利用できるという認識で正しいでしょうか?
> > また、今後もこれらのバージョンでは、行数カウントの高速化は使えないのでしょうか?
> > 可能であれば、spiderが使える、mariadb10または、mysql5.5.14で行数カウント
> > 高速化が使えると非常にうれしいです。
> > 今後も行数カウントが使えない場合は、spiderをあきらめて、mysql5.6系を採用する
> > ことも検討しています。
> >
> > 2.上記URLを参照すると、order by limit の高速化の条件として、order byの指定が
> > カラム(id含む)またはwhere句に指定したmatch...againstであるとありますが、
> > 前者の条件が使える場合がわかりません。
> > ここのカラムとは、FULLTEXTインデックスが張られたカラムのことでしょうか?
> > それともそれ以外の主キー等のINDEXでもよいのでしょうか?
> >
> > 当方の環境では、match...againstのソートの場合、高速化が有効になりますが、
> > 主キーのソートでは、高速化が有効になりません。
> >
> > <実行結果>
> >
> 1.mysql5.5.14の場合、行数カウントが遅い。Mroonga_count_skipはインクリメントされる。(なお、mysql5.5.32、mariadb10.0.3も試してみましたが同様でした。)
> >
> > mysql> select version();
> > +-----------+
> > | version() |
> > +-----------+
> > | 5.5.14    |
> > +-----------+
> > mysql> select count(*) from ftext_2003 where
> > match(title,abstract,claims,description) against("装置") limit 1;
> > +----------+
> > | count(*) |
> > +----------+
> > |   279519 |
> > +----------+
> > 1 row in set (1 min 6.98 sec)
> > mysql> SHOW STATUS LIKE 'Mroonga_count_skip';
> > +--------------------+-------+
> > | Variable_name      | Value |
> > +--------------------+-------+
> > | Mroonga_count_skip | 1     |
> > +--------------------+-------+
> > 1 row in set (0.00 sec)
> >
> > ・mysql5.6.12の場合、行数カウントが早い。Mroonga_count_skipはインクリメントされる。
> > mysql> select version();
> > +-----------+
> > | version() |
> > +-----------+
> > | 5.6.12    |
> > +-----------+
> > 1 row in set (0.00 sec)
> > mysql> select count(*) from ftext_2003 where
> > match(title,abstract,claims,description) against("装置") limit 1;
> > +----------+
> > | count(*) |
> > +----------+
> > |   279519 |
> > +----------+
> > 1 row in set (0.06 sec)
> > mysql> SHOW STATUS LIKE 'Mroonga_count_skip';
> > +--------------------+-------+
> > | Variable_name      | Value |
> > +--------------------+-------+
> > | Mroonga_count_skip | 1     |
> > +--------------------+-------+
> > 1 row in set (0.00 sec)
> >
> >
> 3.mysql5.6.12において、行数カウント高速化が効かないsqlにすると実行結果1とほぼ同じ秒数になる。Mroonga_count_skipはインクリメントされない。
> > mysql> select count(*) from ftext_2003 where
> > match(title,abstract,claims,description) against("装置") and kind = "A"
> limit
> > 1;
> > +----------+
> > | count(*) |
> > +----------+
> > |   275901 |
> > +----------+
> > 1 row in set (1 min 11.53 sec)
> > mysql> SHOW STATUS LIKE 'Mroonga_count_skip';
> > +--------------------+-------+
> > | Variable_name      | Value |
> > +--------------------+-------+
> > | Mroonga_count_skip | 1     |
> > +--------------------+-------+
> > 1 row in set (0.00 sec)
> >
> > 4.mysql5.5.14において、match...againstでorder
> > byすると、高速化が有効。Mroonga_fast_order_limitがインクリメントされる。
> >
> > mysql> select pub_id,match(title,abstract,claims,description)
> against("装置")
> > from ftext_2003 where match(title,abstract,claims,description)
> > against("装置") order by match(title,abstract,claims,description)
> > against("装置") desc limit 10;
> > ・・・
> >
> +--------------+------------------------------------------------------------+
> > 10 rows in set (0.11 sec)
> >
> > mysql> SHOW STATUS LIKE 'Mroonga_fast_order_limit';
> > +--------------------------+-------+
> > | Variable_name            | Value |
> > +--------------------------+-------+
> > | Mroonga_fast_order_limit | 1     |
> > +--------------------------+-------+
> > 1 row in set (0.00 sec)
> >
> > 5.mysql5.5.14において、主キーの1つでorder
> > byすると、高速化が有効にならない。Mroonga_fast_order_limitがインクリメントされない。
> >
> > mysql> select pub_id,match(title,abstract,claims,description)
> against("装置")
> > from ftext_2003 where match(title,abstract,claims,description)
> > against("装置") order by pub_id desc limit 10;
> > ・・・
> >
> +--------------+------------------------------------------------------------+
> > 10 rows in set (1 min 7.00 sec)
> >
> > mysql> SHOW STATUS LIKE 'Mroonga_fast_order_limit';
> > +--------------------------+-------+
> > | Variable_name            | Value |
> > +--------------------------+-------+
> > | Mroonga_fast_order_limit | 1     |
> > +--------------------------+-------+
> > 1 row in set (0.00 sec)
> >
> > 以上です。
> > _______________________________________________
> > groonga-dev mailing list
> > groon****@lists*****
> > http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
>
>
> --
> HAYASHI Kentaro <hayas****@clear*****>
>
> _______________________________________________
> groonga-dev mailing list
> groon****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
>



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