Description:
mysql> select tinyint_col,id_col from tbl_1_all_typeindex_desc ignore index(ndx_tinyint_col) where tinyint_col IN (0,108,110,126,127,-128,16,25,38,42,50,61,74,87,98,NULL) group by 1,2 order by 1,2 limit 14 offset 2;
+-------------+--------+
| tinyint_col | id_col |
+-------------+--------+
| -128 | 68 |
| -128 | 69 |
| -128 | 70 |
| 0 | 71 |
| 0 | 72 |
| 0 | 73 |
| 0 | 74 |
| 0 | 75 |
| 0 | 76 |
| 0 | 77 |
| 0 | 78 |
| 0 | 79 |
| 0 | 80 |
| 0 | 81 |
+-------------+--------+
14 rows in set (0.00 sec)
mysql> select tinyint_col,id_col from tbl_1_all_typeindex_desc force index(ndx_tinyint_col) where tinyint_col IN (0,108,110,126,127,-128,16,25,38,42,50,61,74,87,98,NULL) group by 1,2 order by 1,2 limit 14 offset 2;
+-------------+--------+
| tinyint_col | id_col |
+-------------+--------+
| -128 | 68 |
| -128 | 67 |
| -128 | 66 |
| 0 | 108 |
| 0 | 107 |
| 0 | 106 |
| 0 | 105 |
| 0 | 104 |
| 0 | 103 |
| 0 | 102 |
| 0 | 101 |
| 0 | 100 |
| 0 | 99 |
| 0 | 98 |
+-------------+--------+
14 rows in set (0.00 sec)
How to repeat:
create database test;
use test;
source tbl_1_all_typeindex_desc.sql
select tinyint_col,id_col from tbl_1_all_typeindex_desc ignore index(ndx_tinyint_col) where tinyint_col IN (0,108,110,126,127,-128,16,25,38,42,50,61,74,87,98,NULL) group by 1,2 order by 1,2 limit 14 offset 2;
select tinyint_col,id_col from tbl_1_all_typeindex_desc force index(ndx_tinyint_col) where tinyint_col IN (0,108,110,126,127,-128,16,25,38,42,50,61,74,87,98,NULL) group by 1,2 order by 1,2 limit 14 offset 2;