Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-465

Produce sequential, but unique, document id's

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11
    • None
    • None

    Description

      Currently, if the client does not specify an id (POST'ing a single document or using _bulk_docs) a random 16 byte value is created. This kind of key is particularly brutal on b+tree updates and the append-only nature of couchdb files.

      Attached is a patch to change this to a two-part identifier. The first part is a random 12 byte value and the remainder is a counter. The random prefix is rerandomized when the counter reaches its maximum. The rollover in the patch is at 16 million but can obviously be changed. The upshot is that the b+tree is updated in a better fashion, which should lead to performance benefits.

      Attachments

        1. 041-uuid-gen.t
          4 kB
          Bob Dionne
        2. 041-uuid-gen-seq.ini
          0.0 kB
          Bob Dionne
        3. 041-uuid-gen-utc.ini
          0.0 kB
          Bob Dionne
        4. couch_uuids.patch
          18 kB
          Paul Joseph Davis
        5. uuid_generator.patch
          5 kB
          Robert Newson

        Activity

          People

            Unassigned Unassigned
            rnewson Robert Newson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: