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

Consider cursor_open config option to avoid hashing the uri string

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Configuration
    • Storage Engines
    • StorEng - Defined Pipeline

      In the best case, when we open a cursor with a uri, we already have a cached cursor with the same uri, we just have to find it and return it.  (For a typical application, this should also be the most common case). The cached cursor is stored in a hash table in the session.  To get to the right hash bucket, we hash the uri.  The hashing function has some expense.  We store the hash value in the cursor so when the cursor is closed and we want to put it into the cursor cache, we know what bucket to put it in.

      It turns out the WT_CURSOR->uri_hash is "visible" to applications, though it is undocumented.  So the application could get that hash value and store it alongside the uri after its first cursor open.  Then suppose there is a new a config key to open_cursor, like "uri_hash=<value>".  When set, we could skip the hashing (maybe verify it in diagnostic mode).  This config key would make sense once open_cursor gets compiled configuration in WT-12567, and we can use bind parameters to avoid stringifying and unstringifying the value.

      It's not clear off the bat if this is a win or a strong win, as binding parameters has an expense too.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: