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

Handle simple syntax for array indexing

    XMLWordPrintable

Details

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

    Description

      cc Prasad Varakur Yingyi Bu

      The array index syntax was meant to be simple, but planner limitations forced a more complicated syntax in practice. Support the simple syntax now.

       
      CREATE INDEX idx_suffixes ON `beer-sample`( DISTINCT SUFFIXES( name ) );
       
      EXPLAIN
      SELECT *
      FROM `beer-sample`
      WHERE name LIKE '%Cafe%';
       
      CREATE INDEX idx_tokens ON `beer-sample`( DISTINCT TOKENS( description ) );
       
      EXPLAIN
      SELECT *
      FROM `beer-sample`
      WHERE CONTAINS_TOKEN( description, 'Great' );
       
      CREATE INDEX idx_pairs ON `beer-sample`( DISTINCT PAIRS( SELF ) );
       
      EXPLAIN
      SELECT *
      FROM `beer-sample`
      WHERE name LIKE 'A%' AND abv > 6;
       
      CREATE INDEX idx_address ON `beer-sample`( ALL address );
       
      EXPLAIN
      SELECT MIN( addr )
      FROM `beer-sample`  UNNEST address AS addr;
       
      EXPLAIN
      SELECT COUNT( a )
      FROM `beer-sample` UNNEST address AS a;
       
      EXPLAIN
      SELECT*
      FROM `beer-sample`
      WHERE ANY place IN address SATISFIES place LIKE '100 %' END;
      
      

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty