Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-33006

Use CountTotal for count aggregate on full index scan

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 6.0.0, 5.5.3, 6.0.1, 5.5.4
    • 6.5.0
    • secondary-index
    • Untriaged
    • No

    Description

      Using CountTotal for count aggregate on full index scan (leading key, no group by) can improve the query performance by a big factor as the count is precomputed.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            jeelan.poola Jeelan Poola added a comment -

            Deepkaran Salooja Should we also target it for 5.5.4/6.0.2?

            jeelan.poola Jeelan Poola added a comment - Deepkaran Salooja Should we also target it for 5.5.4/6.0.2?

            For count aggregate pushdown, if the count qualifies for full index scan, it can be answered using the precomputed count, without scanning the index.

            Rules:
            1. No group by
            2. Count aggregate requiring full index scan
            3. Only on the leading key or constant expression
            4. Non distinct count
            5. Array Index is not supported
            6. Primary Index is not supported
            7. Partial Index is supported only for
            a. equality predicate in WHERE clause
            b. if multiple predicates in WHERE clause, only AND is supported. OR is not supported.

            deepkaran.salooja Deepkaran Salooja added a comment - For count aggregate pushdown, if the count qualifies for full index scan, it can be answered using the precomputed count, without scanning the index. Rules: 1. No group by 2. Count aggregate requiring full index scan 3. Only on the leading key or constant expression 4. Non distinct count 5. Array Index is not supported 6. Primary Index is not supported 7. Partial Index is supported only for a. equality predicate in WHERE clause b. if multiple predicates in WHERE clause, only AND is supported. OR is not supported.

            Build couchbase-server-6.5.0-3176 contains indexing commit 6693273 with commit message:
            MB-33006 optimize count for full index scan

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3176 contains indexing commit 6693273 with commit message: MB-33006 optimize count for full index scan
            mihir.kamdar Mihir Kamdar (Inactive) added a comment - This is tested on 6.5.0-3511 using the test plan : https://docs.google.com/document/d/1vQYPLEAnzYJlRFQItngbd3nzCtYljzn1sijAgTo6wyM/edit#

            People

              deepkaran.salooja Deepkaran Salooja
              deepkaran.salooja Deepkaran Salooja
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty