閉じる

mroonga @ mariadb @ Slackware64

今まで自サイトでは日本語全文検索を MySQL + Tritonnでやっていた。
Tritonnの更新が終了して久しく、後継プロジェクトである groongaへ乗り換えるべきだとは思いつつも面倒で避けてきた。
主な理由は groongaの MySQLプラグインである mroongaが標準対応ではないという点だったのだけど、MySQLの派生プロジェクトである MariaDB*1 が mroongaに標準で対応したと聞いてから 1年余。
そろそろやるかと重い腰を上げた。
パッケージのインストール

installpkg mariadb-10.0.22-x86_64-1.txz
データベースの更新
mysql_upgrade
mroongaの有効化
INSTALL PLUGIN Mroonga SONAME 'ha_mroonga.so';
CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME 'ha_mroonga.so';
CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME 'ha_mroonga.so';
CREATE FUNCTION mroonga_command RETURNS STRING SONAME 'ha_mroonga.so';
CREATE FUNCTION mroonga_escape RETURNS STRING SONAME 'ha_mroonga.so';
SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| Mroonga | YES | CJK-ready fulltext search, column store | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
エンジンを変更
alter table TABLE engine=mroonga;
必要ならばインデックスの作成。
alter table TABLE add fulltext index INDEX_NAME(Col1,Col2,Col3,...);

動作自体は問題ないようなのだけど、あからさまに動作が遅くなったな。
メモリをもうちっと積まないと駄目か。


*1 元々の作者が MySQLの名前を売り払って互換性のあるプロジェクトとして立ち上げたので派生というと微妙な気もするが

コメントを残す

メールアドレスが公開されることはありません。必須項目には印がついています *

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)