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?
-
1You can create tables of type MEMORY (or HEAP), but they will be lost on mysql restartsggiroux– ggiroux2011-10-20 19:48:20 +00:00Commented Oct 20, 2011 at 19:48
-
Mysql MEMORY tables has limitations on column types that can be usedAndrei– Andrei2019-01-04 09:45:21 +00:00Commented Jan 4, 2019 at 9:45
3 Answers
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.
Comments
There is a memory database (like innodb). You select that at table creation time.