Mysql 5.1.x
in my.cnf:
log-queries-not-using-indexes = 1
long_query_time = 30
and slow queries are logged
Why I show this at log? Not slow and all fields are indexed.
From mysql.slow.log:
# Query_time: 0.001492 Lock_time: 0.000031 Rows_sent: 229 Rows_examined: 458
use database1;
SET timestamp=1393342939;
SELECT id,name FROM database1 ORDER BY name ASC;
This table has 229 rows, MYISAM.
id and name are indexed
id = auto increment int unsigned
name = varchar(255) utf-8
Can you explain why I show this at not indexed/slow query log?
Summary and more information:
MYISAM TABLE, 229 rows, more columns but all, 229 needed with id and name column. Both has index. At query need all 229 rows to show.
I want 2 things:
- 1.: Don't show that query at slow query/not-using-indexes log.
- 2.: Make that query fast as possible.
Thanks.
You are doing a literal full scan of the table, since you've got no WHERE predicates to index by.