Efficiency_indexseek and indexscan improve sql efficiency

Introduction: This article is compiled by the editor of Programming Notes# for you. It mainly introduces the knowledge related to index seek and index scan to improve SQL efficiency. I hope it has certain reference value for you. Index seek and index scan improve sql efficiencyExplain index seek and index scan:The index is a B tree,index seek is to search from Starting from the root node of the B-tree, find the target row level by level. Index scan traverses the entire B tree from left to right. Assume that the only target row is located on the rightmost leaf node of the index tree (assuming it is a non-clustered index, the tree depth is 2, and the leaf node occupies k pages of physical storage). The IO caused by index seek is 4, while the IO caused by index scan is K, the performance difference is huge. About indexes, you can carefully read the online documentation about the physical database architecture section Do not include operations in the query conditionsThese operations include string concatenation (such as: select * from Users where UserName + ‘ pig’ = ‘Zhang San pig’), the Like operation in front of the wildcard (such as: select…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索