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

BETWEEN comparison operator does not allow exploitation of a covering array index

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • feature-backlog
    • 5.5.0
    • query
    • None

    Description

      create index ix101 ON default (DISTINCT ARRAY v.id FOR v IN a1 END);
      explain SELECT META().id FROM default WHERE ANY v IN a1 SATISFIES v.id BETWEEN 10 AND 20 END;
      

      Above Index and query combination uses Implicit covered array index.
      But not the below combination. The array key is array

       create index ix102 ON default (DISTINCT ARRAY [v.id] FOR v IN a1 END);
       explain SELECT META().id FROM default WHERE ANY v IN a1 SATISFIES [v.id] BETWEEN [10] AND [20] END;
      

      If we transform BETWEEN like below it uses Implicit covered array index.

      explain SELECT META().id FROM default WHERE ANY v IN a1 SATISFIES [v.id] BETWEEN [10] AND [20] END;
      

      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:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty