Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"fast_order_limit" breaks results with offset(Mroongaの同値でのfast_order_limitでoffsetの結果が壊れる) #128

Open
piroor opened this issue Jan 30, 2017 · 1 comment

Comments

@piroor
Copy link

piroor commented Jan 30, 2017

原因および対処法の案: https://ja.osdn.net/projects/groonga/lists/archive/dev/2017-January/004255.html

@kenhys
Copy link
Member

kenhys commented Aug 7, 2019

まだ状況は同じ。MySQL 5.7.27+Mroonga 9.05

MySQL [test]> CREATE TABLE m_fol_test (
    ->   id int primary key auto_increment,
    ->   title varchar(255) not null,
    ->   price int unsigned not null,
    ->   FULLTEXT KEY(title) COMMENT 'tokenizer "TokenBigramSplitSymbolAlphaDigit"',
    ->   KEY (price)
    -> ) ENGINE=Mroonga;
Query OK, 0 rows affected (0.037 sec)

MySQL [test]> INSERT INTO m_fol_test (title, price) VALUES
    -> ('mroonga01', 500),
    -> ('mroonga02', 500),
    -> ('mroonga03', 500),
    -> ('mroonga04', 500),
    -> ('mroonga05', 500),
    -> ('mroonga06', 500),
    -> ('mroonga07', 500),
    -> ('mroonga08', 500),
    -> ('mroonga09', 500),
    -> ('mroonga10', 500);
Query OK, 10 rows affected (0.004 sec)
Records: 10  Duplicates: 0  Warnings: 0

MySQL [test]> select id from m_fol_test where match(title) against('+mroonga' IN BOOLEAN MODE) order by price asc limit 0, 10; 
+----+
| id |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
|  6 |
|  7 |
|  8 |
|  9 |
| 10 |
+----+
10 rows in set (0.042 sec)

MySQL [test]> select id from m_fol_test where match(title) against('+mroonga' IN BOOLEAN MODE) order by price asc limit 0, 5;
+----+
| id |
+----+
|  1 |
|  3 |
|  4 |
|  5 |
| 10 |
+----+
5 rows in set (0.003 sec)

MySQL [test]> select id from m_fol_test where match(title) against('+mroonga' IN BOOLEAN MODE) order by price asc limit 5, 5;
+----+
| id |
+----+
|  6 |
|  7 |
|  8 |
|  9 |
| 10 |
+----+
5 rows in set (0.003 sec)

MySQL [test]> SHOW STATUS LIKE 'Mroonga_fast_order_limit';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Mroonga_fast_order_limit | 3     |
+--------------------------+-------+
1 row in set (0.003 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants