冷丁_ 2022-10-25 21:15 采纳率: 33.3%
浏览 19
已结题

为什么表更新时要清空查询缓存

为什么表更新时要清空查询缓存
为什么表更新时要清空查询缓存
为什么表更新时要清空查询缓存
为什么表更新时要清空查询缓存

  • 写回答

1条回答 默认 最新

  • Shi Er Ge 2022-10-26 11:21
    关注

    这是因为 MySQL 自带的缓存机制,将查询结果进行缓存,如果 table 数据未发生变化,再次使用同一条 SQL 进行查询时,直接从上次的查询结果缓存中读取数据,而不是重新分析、执行 SQL。

    如果 table 数据发生变化,所有与之相关的缓存都会被释放刷新,这样就不会出现数据脏读问题。
    

    The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. If an i dentical statement is received later, the server retrieves the results from the query cache rather than parsing and executing the statement again. The query cache is shared among sessions, so a result set generated by one client can be sent in response to the same query issued by another client.

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 11月6日
  • 已采纳回答 10月29日
  • 创建了问题 10月25日

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度