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

single predicate is sargable to adaptive index it should use it

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Major
    • feature-backlog
    • 5.5.0
    • query
    • None

    Description

      CREATE INDEX ix4 ON default( DISTINCT PAIRS({ type ,domain,data.email.date, data.email.messageId,
       data.email.subject})) WHERE type = "email";
       
      EXPLAIN SELECT *
      from default
      WHERE data.email.date =0
      and data.email.messageId =0
      and data.email.recipient.mail =""
      and data.email.subject
      and type = "email";
      

      Query has predicate on data.email.recipient.mail which is not part of the index. So index is not selected.
      Adaptive index always does Fetch, if single predicate is part of index it should use that index because others will applied post Fetch.

      https://forums.couchbase.com/t/adaptive-index-question/16904

      Attachments

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

        Activity

          People

            keshav Keshav Murthy
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty