I am using a mysql server in which I have set slow query log with following settings
log-slow-queries=/var/log/mysql/mysql-slow-queries.log
long_query_time=1
log-queries-not-using-indexes
I have set following event for every minute in mysql event.
UPDATE mytable SET playing = 0
WHERE playing != 0
AND ( TIMESTAMPDIFF( MINUTE , lastplayed, NOW( )) >10 )
OR ( lastplayed IS NULL
AND ispresent= 0
);
Now all these columns playing, lastplayed, and ispresent
are indexed but still this is appearing in slow query log with following details
# Query_time: 0.000585 Lock_time: 0.000159 Rows_sent: 0 Rows_examined: 316
Why this query is showing in slow log?