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

Allow random cursor scan range to be constrained

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      MongoDB exposes a random sampling operation, which is implemented using a WiredTiger random sampling cursor. There is a new project in MongoDB that aims to allow multiple collections to be grouped into a single WiredTiger table.

      In order to keep using the random sampling cursor when multiple collections are stored in each table, we need to provide a method for constraining the range of values the cursor operates between.

      A possible new API would be:

      WT_CURSOR::range(WT_CURSOR *cursor, const char *config)
      

      Where config is one of:

      • start_range
      • end_range
      • clear_range

      API usage would be:

      s->open_cursor(s, "table:mytable", NULL, "next_random=true", &c); 
      c->set_key(c, "blah");
      c->range(c, "start_range=true");
      c->set_key(c, "foo");
      c->range(c, "end_range=true");
      while (c->next(c) == 0) {
       /* Do stuff */
      }
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: