0

For us, it is very important to get high response time for our website php script which queries a large database. It is essentially getting user information for the user who visited the page. There may be millions of users in the db.

We would like to not bother using the user data at all if the record is not already in the InnoDB Buffer Pool of the MySQL database, and use information only if present in the above cache.

Is there a way to directly ask Mysql/InnoDB whether the record is in cache?

We thought this might have been addressed by many others when developing high performance web apps. Is it not common to get data only if can be retrieved in super quick time (for some scenarios at least where response time is very critical) and not otherwise?

Hannah Vernon
71.1k22 gold badges178 silver badges323 bronze badges
asked May 24, 2018 at 6:23
3
  • Didn't you ask this somewhere else? Commented Jun 2, 2018 at 3:47
  • yes on dba. but there was no reply and we were really in tight situation Commented Jun 2, 2018 at 7:05
  • Even it if were implemented, it might take so much time to do the check that the overall system would be slowed down. I hope you are not using UUIDs; they are terrible. Commented Jun 2, 2018 at 14:43

1 Answer 1

1

There is no built-in mechanism to query the MySQL cache without causing MySQL to bring the row into memory from disk if it is not already in memory.

You might want to consider using a caching layer between your website and the database. Stack Exchange uses Redis; you may want to evaluate that.

answered May 28, 2018 at 16:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.