Michael J. Carey created ASTERIXDB-3175:
-------------------------------------------

             Summary: What's not to LIKE about secondary indexes?
                 Key: ASTERIXDB-3175
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3175
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: COMP - Compiler, HYR - Hyracks, SQL - Translator SQL++
    Affects Versions: 0.9.8.1
            Reporter: Michael J. Carey
            Assignee: Vijay Sarathy
         Attachments: doncdata-noschema.sqlpp, doncdata-schema.sqlpp

Currently the SQL++ compiler doesn't use secondary indexes for LIKE predicates, 
not even in the "standard" prefix case (... LIKE 'Q%') or the exact match case 
(... LIKE 'Q').

For example, you can use either of the two attached setups to create an 
instance of the Don Chamberlin example database and then do:

USE DonCDataSchema; 
CREATE INDEX name_index ON customers(name);
     or:
USE DonCDataNoSchema; 
CREATE INDEX name_index ON customers(name:String);

followed by: 

SELECT * FROM customers WHERE name LIKE 'T. Cruise';
     vs:
SELECT * FROM customers WHERE name = 'T. Cruise';

The index is used for the latter but not the former.  That shouldn't be the 
case!  Also, the index should be used for:

SELECT * FROM customers WHERE name LIKE 'T%';



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to