3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Google Colab で7つの全文検索を試した結果

Last updated at Posted at 2022-07-25

Github

ご覧いただきありがとうございます。
過去の記事も含め、全てのコードをGithubで公開しています。

これまで全文検索について7つのシステムを検証してきました。

今回、検証結果を簡単にまとめます。

使用したのは、日本語wikiから取得した50万件です。検索は「日本語」を含むレコードを取得しました。検索結果の件数は17006件です。IO待ちを含めた処理時間を知りたいので、以下の時間はセルの実行のWall timeです。検索についてはキャッシュの可能性を考慮して2回測定しましたが、1回目でキャッシュが効いていない保証はありません。1回目と2回目が同等の場合、キャッシュが効いていたと見なすべきでしょう。時間の単位は秒です。

システム 索引 登録 索引作成 検索1回目 検索2回目
MySQL なし 605 - 13.6 13.7
MySQL あり 605 3215 8.1 7.7
PostgreSQL なし 579 - 17.8 14.3
PostgreSQL あり 579 880 9.3 9.3
Groonga なし 400 - 29.8 29.1
Groonga あり 400 413 1.7 1.7
Mroonga なし > 2599 11.3 11.1
Mroonga あり > 2599 4.3 4.2
PGroonga なし 617 - 42.5 43.6
PGroonga あり 617 429 10.6 10.3
ElasticSearch あり > 844 7.5 4.0
RediSearch あり > 795 1.3 1.2

今回の検証ではRediSearchが最速でした。Groongaがそれに続いています。MySQLとMroongaは索引作成が非常に遅いことも分かりました。見過ごされがちですが、索引のデータが頻繁に変更される用途では登録の時間も重要です。その点、RediSearchは索引付きの登録も検索も共に最速で非常に優秀です。オンメモリなので当然かもしれません。図らずもRediSearchの宣伝になってしまいましたが、回し者ではありませんので、悪しからず。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?