phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhenhua Xu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-3430) Optimizer not using all columns from secondary index
Date Tue, 01 Nov 2016 14:06:58 GMT
Zhenhua Xu created PHOENIX-3430:
-----------------------------------

             Summary: Optimizer not using all columns from secondary index
                 Key: PHOENIX-3430
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3430
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.8.0
            Reporter: Zhenhua Xu


DROP TABLE IF EXISTS TEST.TEMP;

CREATE TABLE TEST.TEMP (
    ORGANIZATION_ID CHAR(15) NOT NULL,
    NETWORK_ID CHAR(15) NOT NULL,
    ENTITY_ID CHAR(15) NOT NULL,
    SCORE DOUBLE
    CONSTRAINT TOP_ENTITY_PK PRIMARY KEY (
        ORGANIZATION_ID,
        NETWORK_ID,
        ENTITY_ID
    )
) VERSIONS=1;

CREATE INDEX IF NOT EXISTS TEMP_INDEX ON TEST.TEMP (ORGANIZATION_ID, NETWORK_ID, SCORE DESC,
ENTITY_ID DESC);

EXPLAIN
SELECT entity_id, MAX(score) FROM TEST.TEMP
WHERE organization_id = 'organization_id'
  AND (network_id = 'network_id' OR network_id='network_id1')
  AND ((score = 9.0 AND entity_id < 'entity_id') OR score < 9.0)
GROUP BY entity_id
ORDER BY MAX(score) DESC, entity_id DESC
LIMIT 100;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message