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

Intersect scan used for two similar partial indexes

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      When two similar partial indexes are defined, the planner may choose an intersect scan with both indexes when using one of the indexes is more efficient:

      CREATE INDEX ix1 ON default(id) WHERE type = "type1";
      CREATE INDEX ix2 ON default(id, type) WHERE type NOT IN ["type2", "type3"];
       
      explain SELECT * FROM default WHERE type = "type1" AND id = $my_id;
      

      In this case using ix1 is better.

      Attachments

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

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            bingjie.miao Bingjie Miao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty