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

Analytics CBO is choosing suboptimal index paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Morpheus
    • 7.2.0
    • analytics
    • Untriaged
    • 0
    • Unknown
    • Analytics CBO Sprint 18

    Description

      With the CBO, analytics optimizer is choosing two indexes and intersection when it can simply choose one index (wider one).

      create a collection c and load some data; In my case, I loaded 1664 documents.

      create index ic1a on c(a:int);
      create index ic1b on c(a:int, b:int);
       
      analyze analytics collection c;
       
      select count(distinct uuid) from c 
      where a = 1 and b between 100 and 200;
      

      The plan shows the intersection of results from the two scans on ic1a and ic1b.

      the plan can simply choose ic1b and be efficient. query_plan.txt

      Attachments

        Issue Links

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

          Activity

            People

              chanabasappa.ghali Chanabasappa Ghali
              keshav Keshav Murthy
              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