M
M
mit5x2020-04-14 06:43:08
MySQL
mit5x, 2020-04-14 06:43:08

MySQL caching, how to see what is cached?

Hello!

I have a table of products: id, title, price, balance.
The list of goods is displayed on the site with all the data.
The value of the remainder changes very often. Every time the table is updated, the cache is reset.
I want to take out the data on the balances in another table. So that there would be two queries, one to the table with goods, the second to the table with balances. So that the first request would receive data from the cache as often as possible, because. this table will not be updated frequently. And the second request from the cache will be less frequent.

But here the following situation arises, but how to check that I am doing everything right?
How to see that, yes, indeed, the cache contains data on requests to the first table, but data on requests to the second.
But I updated the table of residuals and only the cache for queries to the first table remained?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bkosun, 2020-04-14
@bkosun

Use a profiler like MySQL Profiler:

mysql> SET profiling = 1;
mysql> SELECT * FROM table_name;
mysql> SHOW PROFILES;
mysql> SHOW PROFILE FOR QUERY 1;

https://dev.mysql.com/doc/refman/8.0/en/show-profi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question