phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Afshin Moazami <Afshin.Moaz...@guavus.com>
Subject Re: Unable to filter using local indexes
Date Tue, 15 Dec 2015 15:03:50 GMT
Hi Nacho,

One solution is to include the columns that you like to query over, in your index creation
query.
This works for me:

0: jdbc:phoenix:localhost> create local index idx2 on test_table (col2) include (col1);
2 rows affected (0.642 seconds)
0: jdbc:phoenix:localhost> explain select * from test_table where col2 = 'v1-2' and col1
= 'v1-1';
+------------------------------------------+
|                   PLAN                   |
+------------------------------------------+
| CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TEST_TABLE [-32767,'v1-2'] |
|     SERVER FILTER BY "COL1" = 'v1-1'     |
+------------------------------------------+



I hope it helps.

Best,
Afshin
On Dec 15, 2015, at 8:48 AM, Jacobo Coll <jacobo167@gmail.com<mailto:jacobo167@gmail.com>>
wrote:

create table test_table (mykey varchar primary key, col1 varchar, col2 varchar);
create local index idx2 on test_table (col2);
upsert into test_table (mykey, col1, col2) values('k1', 'v1-1', 'v1-2');
upsert into test_table (mykey, col1, col2) values('k2', 'v2-1', 'v2-2');


Mime
View raw message