2022-08-09 mysql/stonedb-慢SQL-Q16分析

本文深入分析了一个慢SQL查询(Q16),重点探讨了索引条件下推(ICP)的概念和作用。通过MySQL官方示例展示了ICP如何减少回表次数,提高查询效率。同时,文章揭示了在实际查询中未有效利用ICP的原因,并提供了DDL、EXPLAIN查询计划和性能分析,包括Tianmu::core::ColumnBinEncoder::EncoderText_UTF::Encode函数的调用堆栈和火焰图,对比了MySQL和InnoDB的性能差异。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

摘要:

分析慢SQL-Q16

索引条件下推:

ICP(Index Condition Pushdown) - 索引条件下推

什么是ICP

不如换个问法,ICP索引条件下推的作用是什么? 一句话总结:索引条件下推ICP就是尽可量利用二级索引筛除不符合where条件的记录,如此一来减少需要回表继续判断的次数

With ICP enabled, and if parts of the WHERE condition can be evaluated by using only columns from the index, the MySQL server pushes this part of the WHERE condition down to the storage engine.The storage engine then evaluates the pushed index condition by using the index entry and only if this is satisfied is the row read from the table. ICP can reduce the number of times the storage engine must access the
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

悟世者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值