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

Index is not sargable with IN clause

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • feature-backlog
    • 5.5.6, 6.0.3, 6.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      create index ix10 on default(status) WHERE status is not missing and type = "hotel";
      

      explain select 1 from default where type = "hotel" AND status in [$s1];
      

      The above query not able to choose index. Below queries able to choose.
      status IN [$s1] mean implicitly status IS NOT MISSING.

      explain select 1 from default where type = "hotel" AND status in [$s1] and status is not missing;
      explain select 1 from default where type = "hotel" AND status in $s1;
      
      

      Attachments

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

        Activity

          People

            gaurav.jayaraj Gaurav Jayaraj
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty