MonoThreaded
MonoThreaded

Reputation: 12033

MySQL individual table caching

I am hitting a fairly static table with bunch of simple SELECT queries.
In order to increase performance, I am considering writing my own memory cache for that data.
But it feels like doing DB's dirty deeds.

Is there such a thing as a granular caching mechanism for a specific table?

Upvotes: 7

Views: 11513

Answers (3)

Johan
Johan

Reputation: 76537

If you use InnoDB, MySQL will automatically cache the table for you, and create hash-indexes for often used parts of the index.
I suggest you increase the amount of memory MySQL has at its disposal and it should take care of your problems all by itself.
By default MySQL is setup to conserve space, not to run fast.

Here are a few links to get you going with tuning:

http://www.debianhelp.co.uk/mysqlperformance.htm
http://www.mysqlperformanceblog.com/2006/09/29/what-to-tune-in-mysql-server-after-installation/

Also use indexes and write smarter queries.
But I cannot help you there if you don't show us the query.

Upvotes: 6

Pete Wilson
Pete Wilson

Reputation: 8694

You can try copying your static ISAM table into a temporary table that is by definition ram-resident. OTOH, it seems likely to me that the table is already cached, so that might not help much. How about showing us your query?

Upvotes: 0

Len
Len

Reputation: 542

There is a memory database (like innodb). You select that at table creation time.

Upvotes: 1

Related Questions