Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Query planner should use an index if available for any conditional #184

@twitchyliquid64

Description

@twitchyliquid64
./ql 'create table t(thing int, t time);'
./ql 'CREATE INDEX xt_thing ON t(t);'
./ql 'explain SELECT * FROM t WHERE thing = 3 AND t = now();'

┌Iterate all rows of table "t"
└Output field names ["thing" "t"]
┌Filter on thing == 3 && t == now()
│Possibly useful indices
│CREATE INDEX xt_thing ON t(thing);
└Output field names ["thing" "t"]

The query planner should see that there is an index on the column t and use that instead of iterating all rows of table t.

The current query planner will only use a index if it is non-composite, and where it is the first conditional in the WHERE clause.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions