It's a mix between MyIsam and Innodb, the product table currently on Innodb (I didn't design the database, the ERD is non-existent and the normalizing of data is terrible)
The reason why I ask is because with the same setup (both dev & live currently has the same amount of records), i get significant differences in speed between the 2.
The dev machine I'm working on has the same installation/setup as the server AFAIK, except the server has 2 gig more ram (I have 4gig on my dev machine) and dual quad core CPU's (I only have a silly one, can't remember it's name...)
Then the other obvious difference is the OS (but both running IIS7 so not much there)
Natively (sql browser), when I run the queries, the one on my machine runs between 4.85 seconds - 6.2 seconds, whereas the one on the live machine runs 22.34 seconds - 59.89 seconds
Same query, same database (unless someone changed something on the live machine) using it's indexes etc. I initially had some success shaving off about 1 second on my queries by using "like" instead of "match against" but that didn't do much to improve it on the server itself. The other thing could be the hard drive? I have a 10000 rpm SATA laptop drive (which kicks several kinds of asses) on my dev machine whereas I think the server only has a 7200rpm SATA in there (no raid I think)
I'm REALLY confused with this and why it's so slow. I even went and duplicated the "my.ini" from my machine over to the server (the server does run the previous password hash or whatever, whereas my dev doesn't). Max ram mysql uses is about 600-700mb even though the buffer for innodb is set to 4 gig (the db table is only 1gb big)
"subject" (in my example) is a column name.
I really feel dumb... usually I would have figured this out already but can't seem to see where the hell the bottle neck is. I do see some huge spike in Network traffic at some point on the Nic (using "localhost" as the connection) so it might be something to do with how Web Africa setup their webserver? because 127.0.0.1 reverses to xxxx.wadns.net (xxxx = pc name of client). So it might be doing an outbound send to some router through the nic and then comes back in again??
I'll try and figure out how to use explain to see, pity I can't do much on the live server now, OSS workbench is pretty awesome but not on installed on live. Dev team who put this together said there's nothing they could do in terms of speed on the search for this client, unless he bought a caching server.... and I'm like "yea, if you have money you could throw it at new hardware, but ****ty best-practices...or lack thereof, will always mean you have to upgrade instead of code/plan properly)
Thanks for the advice so far. However, re: the count on the InnoDB table, I'm not doing a count on the entire table each time (or maybe it is?), it's to do paging. I need the max records returned by the search query so I can setup the paging to work client side. If you know of a nifty way to do that from inside mysql itself it'd be awesome. I wrote a SQL Server SP which wraps around any other stored procedure or table select that could do paging by itself without hassle, but mysql I'm a bit of a n00b...