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

Allow arbitrary variable names in array index selection

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.6.2, 5.0.0
    • 4.6.2, 5.0.0
    • query
    • None

    Description

      cc Prasad Varakur Yingyi Bu

      N1QL index selection has required matching variable names between array index definition and query predicate. Remove this restriction.

      Previously required:

       
      CREATE INDEX array_idx ON `beer-sample`( DISTINCT ARRAY t FOR t IN TOKENS( description ) END );
       
      EXPLAIN
      SELECT *
      FROM `beer-sample`
      WHERE ANY t IN TOKENS( description ) SATISFIES t = 'cognac' END;
      
      

      The variable t was required to be the same in both places.

      With the restriction removed, the user is only concerned with the logical definition of the index, not the variable names used. This query will also match the above index.

       
      EXPLAIN
      SELECT *
      FROM `beer-sample`
      WHERE ANY foobar IN TOKENS( description ) SATISFIES foobar = 'cognac' END;
      
      

      Attachments

        Issue Links

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

          Activity

            People

              gerald Gerald Sangudi (Inactive)
              gerald Gerald Sangudi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty