You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Swaroopa Kadam (Jira)" <ji...@apache.org> on 2021/05/03 20:14:00 UTC

[jira] [Created] (PHOENIX-6460) Improve the optimizer to consider all plans and prefer regular over reverse scans

Swaroopa Kadam created PHOENIX-6460:
---------------------------------------

             Summary: Improve the optimizer to consider all plans and prefer regular over reverse scans
                 Key: PHOENIX-6460
                 URL: https://issues.apache.org/jira/browse/PHOENIX-6460
             Project: Phoenix
          Issue Type: Improvement
            Reporter: Swaroopa Kadam
             Fix For: 5.1.1, 4.17.0


In QueryOptimizerTest, following test fails, as it uses IDX over view

@Test
public void testChooseIndexOverTable_diffOrder() throws Exception {
 Connection conn = DriverManager.getConnection(getUrl());
 conn.createStatement().execute("CREATE TABLE t (k INTEGER NOT NULL, v1 VARCHAR NOT NULL, v2 VARCHAR CONSTRAINT"
 + " PK PRIMARY KEY (k, v1)) IMMUTABLE_ROWS=true");
 conn.createStatement().execute("CREATE VIEW v(v4 VARCHAR) AS SELECT * FROM t");

 conn.createStatement().execute("CREATE INDEX idx ON v(v1 DESC) INCLUDE (v4)");
 PhoenixStatement stmt = conn.createStatement().unwrap(PhoenixStatement.class);
 QueryPlan plan = stmt.optimizeQuery("SELECT v1 FROM v ORDER BY v1");
 assertEquals("V", plan.getTableRef().getTable().getTableName().getString());
}



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