Stanilovsky Evgeny created IGNITE-13280:
-------------------------------------------

             Summary: Improper index usage, fields enumeration not used with pk 
index creation.
                 Key: IGNITE-13280
                 URL: https://issues.apache.org/jira/browse/IGNITE-13280
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.8.1
            Reporter: Stanilovsky Evgeny
            Assignee: Stanilovsky Evgeny


For example:

{code:java}
CREATE TABLE PUBLIC.TEST_TABLE (FIRST_NAME VARCHAR, LAST_NAME VARCHAR, ADDRESS 
VARCHAR, LANG VARCHAR,  CONSTRAINT PK_PERSON PRIMARY KEY (FIRST_NAME, 
LAST_NAME));

CREATE INDEX "idx2" ON PUBLIC.TEST_TABLE (LANG, ADDRESS);
{code}

and further explain:


{code:java}
SELECT
    "__Z0"."FIRST_NAME" AS "__C0_0",
    "__Z0"."LAST_NAME" AS "__C0_1",
    "__Z0"."ADDRESS" AS "__C0_2",
    "__Z0"."LANG" AS "__C0_3"
FROM "PUBLIC"."TEST_TABLE" "__Z0"
    /* PUBLIC.IDX2: ADDRESS > 0 */
WHERE "__Z0"."ADDRESS" > 0
{code}

this is erroneous  to use "idx2" here, because first index field LANG not 
equals to predicate ADDRESS.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to