[thelist] Optimizing MySQL

Sarah Adams mr.sanders at geekjock.ca
Fri Jan 19 09:44:28 CST 2007

> We have a site based on a LAMP box (Red Hat 9, Apache 1.3, MySQL 4.1, 
> PHP 5).  MySQL is hammering the machine, eating 60-80% of the 1GB of 
> RAM.  To buy some time, we threw in another 1GB of RAM, but we know that 
> ultimately that the problem is the code--/my/ code--with non-efficient 
> queries and perhaps poorly-designed queries.  We plan to upgrade to 
> MySQL 5 within a matter of days, but I don't expect it to make a huge 
> difference in the memory consumption.

Probably the first thing you should look into is implementing indexes
where appropriate (usually on ID columns and columns used in WHERE,
JOIN, ORDER BY, and GROUP BY clauses). Here's a few articles with
further info:

sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca

More information about the thelist mailing list