NAME

mysql_explain_slow_log

Feed a mysqld slow log back into mysql and collect statistics about index usage with EXPLAIN.

DISCUSSION

To optimize your indices, you have to know which ones are actually used and what kind of queries are causing table scans. Especially if you are generating your queries dynamically and you have a huge amount of queries going on, this isn't easy.

Use this tool to take a look at the effects of your real life queries. Then add indices to avoid table scans and remove those which aren't used.

USAGE

mysql_explain_slow_log [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] [--printerror=1] < logfile

--date=YYMMDD select only entrys of date

-d YYMMDD

--host=HOSTNAME db-host to ask

-h HOSTNAME

--user=USERNAME db-user

-u USERNAME

--password=PASSWORD password of db-user

-p PASSWORD

--socket=SOCKET change path to the socket

-s SOCKET

--printerror=1 enable error output

-e 1

EXAMPLE

mysql_explain_slow_log --host=localhost --user=foo --password=bar < /var/lib/mysql/slow.log

AUTHORS

 Jan Willamowius <jan@willamowius.de>, http://www.willamowius.de/mysql-tools.html

SEE ALSO

mysql_explain_log documentation

 


Last updated: 14. Mai 2006
Page maintained by Jan Willamowius
Imprint/Impressum · Privacy/Datenschutz
 
English: Home | Linux | Perl | Java | Eiffel | Books | Music | Jan Willamowius | Updates | Site Map
Deutsch: Home | Badminton | ISBN-Suche | Musik-Suche | Rezepte | Jan Willamowius