-
Notifications
You must be signed in to change notification settings - Fork 322
Open
Labels
bugSomething isn't workingSomething isn't workingsqlSQL standard. definition/revise for a SQL statement/clause etcSQL standard. definition/revise for a SQL statement/clause etc
Description
For a index optimizer, the most common pattern is, for example, SQL SELECT * FROM t1 WHERE gp = {const_val}
, is optimized based on FILTER expression gp = {const_val}
:
So if index key=gp
exists for table t1, that index is utilized, as ** SEEK BY KEY {const_val}
>> OUTPUT ALL ROWS`**.
However, if {const_val}
is NULL
, this optimize rule should not go that approach, since <ANY_VAL> = NULL
is NULL
.
This also happens for SQL like LAST JOIN t1 LAST JOIN t2 on t1.key = t2.key
, where there is row exists in t1 that t1.key = NULL
. It never joins.
Optimizer should consider const NULL values, and Runner should consider NULL values as index_key
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsqlSQL standard. definition/revise for a SQL statement/clause etcSQL standard. definition/revise for a SQL statement/clause etc