The first statement creates index, not view. 

Can you check ?

Cheers

> On Oct 22, 2016, at 1:51 AM, Mich Talebzadeh <mich.talebza...@gmail.com> 
> wrote:
> 
> Hi,
> 
> I have a Hbase table that is populated via
> org.apache.hadoop.hbase.mapreduce.ImportTsv
> through bulk load ever 15 minutes. This works fine.
> 
> In Phoenix I created a view on this table
> 
> jdbc:phoenix:rhes564:2181> create index marketDataHbase_idx on
> "marketDataHbase" ("price_info"."ticker", "price_info"."price",
> "price_info"."timecreated");
> 
> This also does what is supposed to do and shows correct count.
> 
> I then created an index in Phoenix as below
> 
> create index index_dx1 on "marketDataHbase"
> ("price_info"."timecreated","price_info"."ticker", "price_info"."price");
> 
> that showed the records OK at that time. I verified this using explain
> 
> 
> 0: jdbc:phoenix:rhes564:2181> explain select count(1) from
> "marketDataHbase";
> +---------------------------------------------------------+
> |                          PLAN                           |
> +---------------------------------------------------------+
> | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER INDEX_DX1  |
> |     SERVER FILTER BY FIRST KEY ONLY                     |
> |     SERVER AGGREGATE INTO SINGLE ROW                    |
> +---------------------------------------------------------+
> 
> Now the issue is that the above does not show new data since build in Hbase
> table unless I do the following:
> 
> 0: jdbc:phoenix:rhes564:2181> alter index INDEX_DX1 on "marketDataHbase"
> rebuild;
> 
> 
> Which is not what an index should do (The covered index should be
> maintained automatically).
> The simple issue is how to overcome this problem?
> 
> As I understand the index in Phoenix ia another file independent of the
> original phoenix view so I assume that this index file is not updated for
> one reason or other?
> 
> Thanks

Reply via email to