7

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?

2
  • 1
    You can create tables of type MEMORY (or HEAP), but they will be lost on mysql restarts Commented Oct 20, 2011 at 19:48
  • Mysql MEMORY tables has limitations on column types that can be used Commented Jan 4, 2019 at 9:45

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

1 Comment

InnoDB will cache everything if it has enough buffer space available.
0

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?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.