DROP TABLE IF EXISTS memos;
SET NAMES utf8mb4;
CREATE TABLE memos (
id int PRIMARY KEY,
tag ENUM('Groonga', 'Mroonga'),
content TEXT,
FULLTEXT INDEX(content),
KEY(tag),
KEY(id)
) DEFAULT CHARSET=utf8mb4;
INSERT INTO memos VALUES(1, 'Groonga', 'Groonga is great!');
INSERT INTO memos VALUES(2, 'Mroonga', 'Mroonga is great!');
INSERT INTO memos VALUES(3, 'Mroonga', 'Mroonga is a MySQL storage engine.');
INSERT INTO memos VALUES(4, 'Mroonga', 'Mroonga is based on Groonga.');
SELECT * FROM memos
WHERE MATCH(content) AGAINST("+Groonga" IN BOOLEAN MODE) AND
tag = 'Mroonga'
         ORDER BY id LIMIT 1;
id	tag	content
4	Mroonga	Mroonga is based on Groonga.
SHOW STATUS LIKE 'mroonga_fast_order_limit';
Variable_name	Value
Mroonga_fast_order_limit	1
DROP TABLE memos;
