If you're not using indexes, that could well explain why your selects are slow. What you want to do is identify the columns you are selecting on, (like if you have select * from mytable where name="bob"), and index those columns. (In this case, index the "name" column). If you are doing joins, index the columns of both tables you are joining on. Refer to the MySQL manual for help:
| [reply] [d/l] |
To add to beable's answer, make sure that the columns you're joining together are the EXACT same datatype, down to the size. Otherwise, MySQL will make very expensive conversions, slowing your query down considerably. (In one of my tests, a 10second query didn't finish in 4 hours.)
Always read the docs for something you plan on basing your application on. Why do people assume that complex applications like RDBMS's can simply be loaded up and they'll work perfectly the first time?!?
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |