mysql slow log query details about Query_time -
i using mysql : 5.5.31-0ubuntu0.12.04.1-log (ubuntu) , enabled slow log query ,slow log query time set 2 sec details :
show variables 'slow_launch_time'; +------------------+-------+ | variable_name | value | +------------------+-------+ | slow_launch_time | 2 | +------------------+-------+ 1 row in set (0.00 sec)
and in my.cnf :
long_query_time = 2
it means query takes more 2 sec, stored in mysql slow log query.
when tried using select sleep(1) ; select sleep(2) ; select sleep(3) ; , viewed slow log query ,only sleep(2) , sleep(3) saved in slow log query query_time: # query_time: 2.000263 , # query_time: 3.000278 respectively . saw many queries have query_time less 2 sec saved in slow log query
for more details :
# query_time: 0.001775 lock_time: 0.000154 rows_sent: 1 rows_examined: 120
why type of query saved in slow log , don't understand ?
probably because log_queries_not_using_indexes
on:
if using option slow query log enabled, queries expected retrieve rows logged. see section 5.2.5, “the slow query log”. option not mean no index used. example, query uses full index scan uses index logged because index not limit number of rows.
Comments
Post a Comment