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

More efficient implementation of the DB updater BTree functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1, 1.2, 2.0.0
    • Database Core
    • 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

        1. COUCHDB-1027.patch
          2 kB
          Filipe David Borba Manana

        Activity

          People

            fdmanana Filipe David Borba Manana
            fdmanana Filipe David Borba Manana
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: