跳到主要内容

1 篇博文 含有标签「calculation on index column」

查看所有标签

SQL实战经验 - 运算导致索引失效

· 阅读需 7 分钟
PawSQL Team
Optimize your SQL Queries by Clicks!

Copyright © 2024 PawSQL

Problem

Let's say we have a b-tree index c_acctbal_idx defined on table tpch.customer to accelarate queries with a condition on column c_acctbal. Let's check a query as follows:

select * from tpch.customer where c_acctbal + 100 = 10000.0

Use explain to get the query plan: