Tudor is a techie turned manager who fights like mad to keep his tech skills honed and relevant. Everything from web hosting, networking, *nix and the like. Constantly developing and co-ordinating with others to make the web a better (and easier to use) place.
Tuesday, 14th Feb 2012 Posted @ 23:05
So I was wondering how well my music database was performing, so I added a few entries to my /etc/my.cnf:
log_slow_queries=/var/log/mysqld.slow.logI then checked the mysqld.slow.log file to see what was going on, as it was now logging queries that take over a second and queries that are not using an index.
long-query-time=1
log-long-format
log-queries-not-using-indexes
ALTER TABLE blah ADD INDEX blahcolumn (column)commands I tested again. None of the queries were being logged and they were executing a damn sight faster. Cutting down the return of a 500 row table by 40% was a decent enough improvement :)
[ no comments : Add ]