-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Hi!
We have cases when queries to storage looks like next:
tbl.x > X1 AND tbl.y == Y1 AND (tbl.z == Z1 || tbl.z == Z2)
Where for all conditions exists indexes (tbl_index_x, tbl_index_y, tbl_index_z) and order of results is important, it should be ordered by tbl_index_x (first condition tbl.x > X1). Right now, we will transform queries to disjunction of conjunction
(tbl.x > X1 AND tbl.y == Y1 AND tbl.z == Z1) OR (tbl.x > X1 AND tbl.y == Y1 AND tbl.z == Z2)
and make 2 separate join cursors for every AND condition. Then using merge sort we get required order for results of next() call for join cursors. It will be nice if we will be able to create one AND join index with ordering index == tbl_index_x and with nested OR index. Limitation for OR join is ok for us, it can be restricted by "compare" == "eq" and by all reference cursors in a OR join should be on the same table.