沈宗强 created PHOENIX-3753: ---------------------------- Summary: The salt index affects the query plan of the non-salt table Key: PHOENIX-3753 URL: https://issues.apache.org/jira/browse/PHOENIX-3753 Project: Phoenix Issue Type: Bug Affects Versions: 4.9.0 Reporter: 沈宗强
The salt index affects the query plan of the non-salt table, Can be reproduced by the following example: 1.Create table: CREATE TABLE IF NOT EXISTS test1 ( date varchar NOT NULL, cust_id INTEGER NOT NULL, agent_id INTEGER, pay BIGINT, click BIGINT, pv BIGINT, CONSTRAINT pk PRIMARY KEY (date, cust_id) ); 2.Create index: CREATE INDEX ix_test1 ON test1(agent_id) INCLUDE (pay, click) SALT_BUCKETS = 10; 3.Explain query: EXPLAIN SELECT SUM(pay), SUM(click) FROM test1 WHERE DATE = '2017-01-01'; 4.Expected result: +---------------------------------------------------------------------+ | PLAN | +---------------------------------------------------------------------+ | CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER TEST1 ['2017-01-01'] | | SERVER AGGREGATE INTO SINGLE ROW | +---------------------------------------------------------------------+ 5.Actual results: +---------------------------------------------------------------------+ | PLAN | +---------------------------------------------------------------------+ | CLIENT 10-CHUNK PARALLEL 10-WAY RANGE SCAN OVER IX_TEST1 [0] - [9] | | SERVER FILTER BY "DATE" = '2017-01-01' | | SERVER AGGREGATE INTO SINGLE ROW | +---------------------------------------------------------------------+ -- This message was sent by Atlassian JIRA (v6.3.15#6346)