MySQL Forums
Forum List  »  Newbie

Re: How do I load a copy of a table into RAM for frequent reading?
Posted by: Phillip Ward
Date: October 25, 2021 06:36AM

Quote

One of its databases contains a small table - about five fields and several dozen records. The records are not changed often - once every few hours. But, unfortunately, several dozen machines read records from this table every thirty seconds.

Is there a way to specify that a specific table should always be completely duplicated in memory without any conditions?

You do not need to.

MySQL's Buffer Cache is the in-memory area into which [pages of] "in-use" tables are loaded.
Do not think of this as "duplication" of some part of the DataFiles. In fact, I'd suggest you forget all about the DataFiles and think of MySQL as a living, breathing Process with which you interact.

A basic Rule of Thumb for the Buffer Cache is this:
 
If it's used a lot, it will be in the Buffer Cache [a lot]

Both your "Read" and "Write" processes are making use of that table and so will keep it loaded into the Buffer Cache without you needing to do anything special. If you do find that this, busy table is being paged out of the Cache, that might suggest that your Cache is actually undersized.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I load a copy of a table into RAM for frequent reading?
October 25, 2021 06:36AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.