NAMEmysql_explain_log Feed a mysqld general logfile (created with mysqld --log) back into mysql and collect statistics about index usage with EXPLAIN. DISCUSSIONTo 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. USAGEmysql_explain_log [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] < 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 EXAMPLEmysql_explain_log --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log AUTHORSStefan NitzJan Willamowius <jan@willamowius.de>, http://www.willamowius.de Dennis Haney <davh@davh.dk> (Added socket support) SEE ALSOmysql documentation | ||
|
Last updated: 14. Mai 2006 Page maintained by Jan Willamowius Impressum · Datenschutz | Deutsch: Home | Badminton | ISBN-Suche | Musik-Suche | Rezepte | Jan Willamowius |