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

More efficient implementation of the DB updater BTree functions

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1, 1.2, 2.0.0
    • Component/s: Database Core
    • Labels:
      None

      Description

      Currently, some of the BTree functions (by_id BTree reduce function and and by_seq BTree split function) traverse the same input lists several times to produce the output. This is not optimal. For example, the btree_by_id_reduce function, for a database with 300 000+ documents, can easily get a list of 50 or more #full_doc_info records. This functions traverses that list 4 times - 2 filtered list comprehensions plus two length/1 calls.

      The following patch changes the implementation to produce the same output with a single list traversal operation.

        Attachments

          Activity

            People

            • Assignee:
              fdmanana Filipe Manana
              Reporter:
              fdmanana Filipe Manana
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: