Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2360

Allow disjunctions and combinations of operations in join cursors

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.0
    • 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.

            Assignee:
            donald.anderson@mongodb.com Donald Anderson
            Reporter:
            Denis Shkirya Denis Shkirya
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: