SQL实战经验 - 隐式类型转换导致索引失效
Copyright © 2024 PawSQL
问题定义
Let's say the O_ORDERDATE
column in TPCH.ORDERS
table is defined as VARCHAR(16)
, and there is an index ORDDATE_IDX
on ORDERS(O_ORDERDATE)
to accelerate the queries against this table if there is a condition on O_ORDERDATE
. If we want to count the number of orders of today using following SQL query.