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

Add additional logic to cursor->search_near to handle range bounds.

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0, WT11.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 8
    • Storage Engines - 2022-06-27, Storage Engines - 2022-07-11

      The expectation of cursor search near is that it will return the nearest value inside the bounds if one exists. If we have a keyrange from A > Z and the user sets the bounds F>L then calls
      set_key with a key outside the range, e.g. P search_near should return L.

      As a first step the search near will check if the provided cursor is bounded, and if so it will determine if the provided key exists within the bounds. If not the search_near key will be changed to the nearest bound.

      Search near then internally performs a cursor_row_search or cursor_col_search, if those return the key and it is visible we need to determine whether the bounds were inclusive, if they were than that key is valid otherwise the logic will default to the cursor->next, cursor->prev iterations.

      Scope:

      • Add the required logic to search_near.
      • Add statistics for when it changes the search key and when inclusive results in a key not being valid.
      • Add python tests.

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

              Created:
              Updated:
              Resolved: