1

I know in Postgres, we can explicitly load a table into the cache using pg_prewarm extension, is there a similar mechanism/UDF/etc in MySQL? I know MySQL would cache data in shared buffer implicitly, but is there a way to explicitly do so? Thanks!

1 Answer 1

2

Not quite the same thing, but see innodb_buffer_pool_dump_at_shutdown as a way of somewhat quickly getting back to where you left off after a shutdown. It saves pointers to blocks, so shutdown is not slowed significantly.

A crude alternative is to do something like SELECT AVG(col) FROM tbl where col is not indexed. However, if the table is bigger than the buffer_pool, be aware that some of the cached data will be pushed out before the query is finished.

1
  • Thanks for answering! I can confirm that all data is in shared buffer now, thanks! Mar 23, 2022 at 0:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.