开发者

MySQL table caching returns stale data

开发者 https://www.devze.com 2023-01-18 02:39 出处:网络
I have query caching disabled (it\'s disabled by default on my installation) but kept getting outdated data in my application. For example, I would do a SELECT * on my review table, insert a new row a

I have query caching disabled (it's disabled by default on my installation) but kept getting outdated data in my application. For example, I would do a SELECT * on my review table, insert a new row and then do another SELECT *, but the new review wouldn't show up (although it would be there if I browsed to the table in phpMyAdmin). I disabled table caching (table_cache = 0) and things started working fine, with all new reviews showing up on the second SELECT *.

The MySQL documentation says that

The query cache does not return stale data. When tables 开发者_JAVA技巧are modified, any relevant entries in the query cache are flushed.

Is this not true for the table cache as well? Is there a way to have MySQL use table caching, but force it to flush the cache once a cached table is modified? I couldn't really find much to go by in the documentation .

0

精彩评论

暂无评论...
验证码 换一张
取 消