[CQF] Query using range predicate on descending index does not return correct results

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • QO 2022-07-11, QO 2022-07-25, QO 2022-08-08
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This bug is related to CQF/bonsai only.

      coll.insertOne({a: 1});
      coll.createIndex({a: -1});
      const res = coll.find({a : {$gte: 0, $lte: 2}}).toArray();
      

      The query above should always return the one document but instead sometimes returns nothing, dependent on which plan is chosen and if the index is used. Note that if

      for (i = 0; i < 100; ++i) coll.insert({}) 

      is added, a plan using the descending index will always be chosen, and the query will return no results.

            Assignee:
            Daniel Segel
            Reporter:
            Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: