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

Save the user provided cursor bounds to the cursor

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.0.0, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 5
    • Storage - Ra 2022-05-30, Storage - Ra 2022-06-13

      We have implemented a skeleton API that allows the user to call cursor->bound, now we should save the provided bounds into the cursor b-tree.

      The cursor->set_key method will be used to allow the user to specify the given bound. An example usage looks as follows:

      cursor->set_key(cursor, “A”)
      cursor->bound(cursor, “bound=lower”)
      cursor->set_key(cursor, “K”)
      cursor->bound(cursor, “bound=upper,inclusive=false”)
      cursor->set_key(cursor, “J”)
      cursor->search_near(cursor)
      cursor->reset(cursor) 
      

      This will require four new flags to be added to the CBT. The new flags will be CURSOR_BOUND_UPPER, CURSOR_BOUND_LOWER, CURSOR_BOUND_UPPER_INCL, CURSOR_BOUND_LOWER_INCL. A new #define will be added for simplification CURSOR_HAS_BOUNDS = F_ISSET(CBT, CURSOR_BOUND_UPPER | CURSOR_BOUND_LOWER).

      The API should check that a key is set before applying it to the CBT as a raw key.

      Scope:

      • Implement the key setting and flag logic.
      • Update the existing cursor bound python test to check that key setting logic works as expected.
      • Clear the bounds when cursor->reset() is called. Increment a statistic when bounds are cleared via reset.

      Extended scope:

      • If time permits check whether the bounds are overlapping and return EINVAL. Otherwise create a follow on jira.

            Assignee:
            jie.chen@mongodb.com Jie Chen
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: