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

Investigate creating a cursor type for row store with raw schema to boost the performance of MongoDB use cases

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • StorEng - Refinement Pipeline
    • None

      WT-9786 and WT-11932 has shown that there is big potential to boost mongodb performance by reducing the number of api calls to WT and reducing the number of checks we do internally within WT. However, it is hard to do that with the current cursor implantation because it has to work for all table types and schema. If we can create a separate cursor implementation for mongodb, we potentially can remove a lot of internal checks and improve mongodb's performance. The new cursor type should only be allowed to work with raw schema type and row store. These can be easily checked at the time of cursor open and doesn't need to be checked at each api call. In addition, if we limit the cursor can only be called with a transaction and snapshot isolation, we can replace some internal checks with a simple check for transaction and isolation for each api call and thus further boost performance.

      For example, we can remove the following checks if we know that we are running with snapshot isolation:

          /*
           * If this is an ordinary transactional cursor, make sure we are set up to read.
           */
          if (!WT_READING_CHECKPOINT(session))
              __wt_txn_cursor_op(session);
      
      API_RETRYABLE(session);
      

      If we can further limit or agree that the new cursor can only be called by user but not WT internally, we can remove this check from its code path as well:

          /* If the transaction is idle, check that the cache isn't full. */
          WT_RET(__wt_txn_idle_cache_check(session));
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: