Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Incomplete
-
None
Description
My goal there will be to add an hidden index to get last availabe value.
We have a table with few values, but an history of 1 000 000 of lines.
select * from mysql_server;
|
...
|
23 rows in set (16,225 sec) |
if specifiy all id from the PK
MariaDB [pmacontrol]> select id from mysql_server;
|
+----+
|
| id |
|
+----+
|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 24 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
+----+
|
23 rows in set (1,070 sec) |
=> a bit long but better
then select all and specify the ids :
select * from mysql_server where id in(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24); |
....
|
23 rows in set (0,001 sec) |
|
it's really fast, so I believe there is a way to improve the optimizer with response time