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

Investigate restoring the cursor position while doing search near to avoid visiting already seen records.

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 8
    • Storage Engines - 2022-10-03, Storage Engines - 2022-10-17, Storage Engines - 2022-10-31, 2024-02-20_A_near-death_puffin

      Search_near guarantees that it will return a record either side of the search key if one is visible, to do this it performs an initial cursor_row/col_search followed by a cursor->next loop, and if nothing is found then a cursor->prev loop. This isn't that efficient as the cursor->prev loop starts it's walk at the beginning of the tree instead of where the original call to cursor_row/col_search placed the cursor.

      This behaviour is required for lower isolation levels such as read_committed however for snapshot isolation we can guarantee that if no records were seen in the cursor->next walk there won't be any for the same range in the cursor->prev walk. This present an opportunity for optimization and would benefit both regular cursor->search_nears and bounded cursor search_nears.

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

              Created:
              Updated:
              Resolved: