New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
mysql slow LOG
I enable mysql slow log query
this comes on
# Time: 200924 5:13:42
# User@Host: hostcbtdb[hostcbtdb] @ [172.18.0.11]
# Thread_id: 90327 Schema: hostcbtdb QC_hit: No
# Query_time: 0.000285 Lock_time: 0.000081 Rows_sent: 1 Rows_examined: 1
# Rows_affected: 0 Bytes_sent: 1078
SET timestamp=1600924422;
SELECT * FROM smkwp2_bsfsm_options;
why is it there ? is that query slow ? what's wrong with the query ?
This is my init command
SET GLOBAL slow_query_log = 'ON';
set global log_queries_not_using_indexes = 'OFF';
set global slow_query_log_file ='/var/log/mysql/slow-query-2.log';
set global long_query_time = 20;
How to find what's wrong with that query ?
Thanked by 1kyaky
Comments
log_queries_not_using_indexes
is on and that query isn't using an index?If I'm not wrong, according to that, even your slowest query should run at roughly 3.5k QPS.
it's a SELECT * FROM sometables.
It doesn't need index.
The question is, why that query logged into slow query log ?
The option is
log_queries_not_using_indexes
notlog_queries_not_using_indexes_where_it_would_be_sensible
I have no idea what are you talking about.
I have tried changing it, nothing. It still the same.
exactly https://mariadb.com/kb/en/server-system-variables/#log_queries_not_using_indexes
What's a "FULL INDEX SCAN" ?
It's when the whole index is read to find a value. Usually caused by joins or filters on columns that aren't an index key, but are included in an index. MySQL doesn't seem to use the INCLUDE keyword, so most likely this would come up when you've got a composite key but are not joining on all keys in the composite.
Polish up your Google-fu
google still the best Guru
I still did not understand whats wrong with my query. Does that mean my query will still be logged even though it has no problem ? Is the problem lying in my tables structure ?
dear database god,
why the hell date, time using varchar?
a little bit brain will help than let it idle.
to make it easier for my client exporting from phpmyadmin to csv. Also I don't need to format it every damn time when I retrieve it from the database. What's the problem with that ? do varchar date comparison much faster than string comparison ?
Also does it cause my issue here ?