If you find unlisted SQL command and confirm whether the SQL command works well or not, we want to list it. Please mail it to us or send a patch against the source file by pull request system on GitHub.
Here are the explanations of server variables that are introduced by mroonga.
The default parser of the full text search. The default value can be specified by --with-default-parser=PARSER configure argument, whose default value is TokenBigram.
Here is an example to use TokenBigramSplitSymbolAlphaDigit as a fulltext search parser. It is used by body_index fulltext index.
1 2 3 4 5 6 | SET GLOBAL mroonga_default_parser=TokenBigramSplitSymbolAlphaDigit;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
body TEXT,
FULLTEXT INDEX body_index (body)
) DEFAULT CHARSET UTF8;
|
The version string of the groonga library.
Here is an example SQL to confirm the using groonga library version:
mysql> SHOW VARIABLES LIKE 'mroonga_libgroonga_version';
+----------------------------+------------------+
| Variable_name | Value |
+----------------------------+------------------+
| mroonga_libgroonga_version | 1.2.8-9-gbf05b82 |
+----------------------------+------------------+
1 row in set (0.00 sec)
The path of the log file of mroonga. The default value is groonga.log.
Here is an example transcript to change log file to /tmp/mroonga.log:
mysql> SHOW VARIABLES LIKE 'mroonga_log_file';
+------------------+-------------+
| Variable_name | Value |
+------------------+-------------+
| mroonga_log_file | groonga.log |
+------------------+-------------+
1 row in set (0.00 sec)
mysql> SET GLOBAL mroonga_log_file = "/tmp/mroonga.log";
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'mroonga_log_file';
+------------------+------------------+
| Variable_name | Value |
+------------------+------------------+
| mroonga_log_file | /tmp/mroonga.log |
+------------------+------------------+
1 row in set (0.00 sec)
The output level of mroonga log file. The default value is NOTICE.
Here is an example transcript to change log level to DEBUG that logs many messages for debugging:
mysql> SHOW VARIABLES LIKE 'mroonga_log_level';
+-------------------+--------+
| Variable_name | Value |
+-------------------+--------+
| mroonga_log_level | NOTICE |
+-------------------+--------+
1 row in set (0.00 sec)
mysql> SET GLOBAL mroonga_log_level = "debug";
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'mroonga_log_level';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| mroonga_log_level | DEBUG |
+-------------------+-------+
1 row in set (0.00 sec)
The version string of mroonga.
Here is an example SQL to confirm the running mroonga version:
mysql> SHOW VARIABLES LIKE 'mroonga_version';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| mroonga_version | 1.10 |
+-----------------+-------+
1 row in set (0.00 sec)
Whether really write data to groonga database or not. The default value is OFF that means data are really written to groonga database. Usually we don't need to change the value of this variable. This variable is useful for benchmark because we can measure processing time MySQL and mroonga. It doesn't include groonga's processing time.
Here is an example SQL to disable writing data to groonga database:
mysql> SHOW VARIABLES LIKE 'mroonga_dry_write';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| mroonga_dry_write | OFF |
+-------------------+-------+
1 row in set (0.00 sec)
mysql> SET mroonga_dry_write = true;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'mroonga_dry_write';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| mroonga_dry_write | ON |
+-------------------+-------+
1 row in set (0.00 sec)
Whether enable optimization or not. The default value is ON that means optimization is enabled. Usually we don't need to change the value of this variable. This variable is useful for benchmark.
Here is an example SQL to disable optimization:
mysql> SHOW VARIABLES LIKE 'mroonga_enable_optimization';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| mroonga_enable_optimization | ON |
+-----------------------------+-------+
1 row in set (0.00 sec)
mysql> SET mroonga_enable_optimization = false;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'mroonga_enable_optimization';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| mroonga_enable_optimization | OFF |
+-----------------------------+-------+
1 row in set (0.00 sec)
The threshold to determin whether match method is escalated. See search specification for groonga about match method escalation.
The default value is the same as groonga's default value. It's 0 for the default installation. The dafault value can be configured in my.cnf or by SET GLOBAL mroonga_match_escalation_threshold = THRESHOLD;. Because this variable's scope is both global and session.
Here is an example to use -1 as a threshold to determin whether match method is escalated. -1 means that never escalated.
1 | SET GLOBAL mroonga_match_escalation_threshold = -1;
|
Here is an another example to show behavior change by the variable value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
tags TEXT,
FULLTEXT INDEX tags_index (tags) COMMENT 'parser "TokenDelimit"'
) ENGINE=mroonga DEFAULT CHARSET=UTF8;
-- Test data
INSERT INTO diaries (title, tags) VALUES ("Hello groonga!", "groonga install");
INSERT INTO diaries (title, tags) VALUES ("Hello mroonga!", "mroonga install");
-- Matches all records that have "install" tag.
SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("install" IN BOOLEAN MODE);
-- id title tags
-- 1 Hello groonga! groonga install
-- 2 Hello mroonga! mroonga install
-- Matches no records by "gr" tag search because no "gr" tag is used.
-- But matches a record that has "groonga" tag because search
-- method is escalated and prefix search with "gr" is used.
-- The default threshold is 0. It means that no records are matched then
-- search method is escalated.
SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
-- id title tags
-- 1 Hello groonga! groonga install
-- Disables escalation.
SET mroonga_match_escalation_threshold = -1;
-- No records are matched.
SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
-- id title tags
-- Enables escalation again.
SET mroonga_match_escalation_threshold = 0;
-- Matches a record by prefix search with "gr".
SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
-- id title tags
-- 1 Hello groonga! groonga install
|
Here are the explanations of status variables that are introduced by mroonga.
This value is increased when 'fast line count feature' is used. You can use this value to check if the feature is working when you enable it.
Here is an example how to check it:
mysql> SHOW STATUS LIKE 'mroonga_count_skip';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| mroonga_count_skip | 0 |
+--------------------+-------+
1 row in set (0.00 sec)
This value is increased when 'fast ORDER BY LIMIT feature' is used. You can use this value to check if the feature is working when you enable it.
Here is an example how to check it:
mysql> SHOW STATUS LIKE 'mroonga_fast_order_limit';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| mroonga_fast_order_limit | 0 |
+--------------------------+-------+
1 row in set (0.00 sec)