I've got a problem with perfomance of my mysql queries. I've got a very big table
create table query(
id Integer,
session Integer,
time Integer,
name Integer,
region Integer);
Volume of data - 2 gb .I've made index on "name" - 7 gb.
My queries look like:
select count(id) from query where name=somevalue;
I wouldn't add any new data, and I used standard "my-huge.cnf". Still, I spend about 4-5 seconds per query, I'm going to do about 9-10*45000 queries. Which options should I change to increase speed, if my computer has 2gb memory.
A count(*) may run marginally faster.
Also you may consider caching the counts in a separate table and querying from that.