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

Server-Analytics: Indexed data is not used when there is a "or" present in where predicate.

    XMLWordPrintable

Details

    Description

      Run the below statements:

      create bucket beer_sample with {"name":"beer-sample"};
      create shadow dataset beer_ds on beer_sample;
      create index idx_city on beer_ds(geo.lat:double,city:string);
      select * from Metadata.`Index` where DatasetName='beer_ds' and IsPrimary=False
      connect bucket beer_sample
      SELECT count(*) FROM `beer_ds` where geo.lat=49.7652 or city='San Francisco';
      EXPLAIN SELECT count(*) FROM `beer_ds` where geo.lat=49.7652 or city='San Francisco';

      When you examine the last query above, observe that it is referring to data_scan instead on index_scan.

      Attachments

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

        Activity

          People

            vijay.sarathy Vijay Sarathy
            ritesh.agarwal Ritesh Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty