You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Vamsi Krishna <va...@gmail.com> on 2016/06/28 11:18:05 UTC

For multiple local indexes on Phoenix table only one local index table is being created in HBase

Team,

I'm using HDP 2.3.2 (HBase : 1.1.2, Phoenix : 4.4.0).
*Question:* For multiple local indexes on Phoenix table only one local
index table is being created in HBase. Is this regular behavior? Can
someone explain why?

Phoenix:
CREATE TABLE IF NOT EXISTS VAMSI.TABLE_B (COL1 VARCHAR(36) , COL2
VARCHAR(36) , COL3 VARCHAR(36) CONSTRAINT TABLE_B_PK PRIMARY KEY (COL1))
COMPRESSION='SNAPPY', SALT_BUCKETS=5;
CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL2 ON VAMSI.TABLE_A (COL2);
CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL3 ON VAMSI.TABLE_A (COL3);

hbase(main):012:0> list '_LOCAL.*'
TABLE
_LOCAL_IDX_VAMSI.TABLE_A

Thanks,
Vamsi Attluri
-- 
Vamsi Attluri

Re: For multiple local indexes on Phoenix table only one local index table is being created in HBase

Posted by vikashtalanki <vt...@visa.com>.
Hi Vamsi,

Creating a single hbase table for all LOCAL indexes of a phoenix data table
is a regular/expected behavior.
Phoenix local indexes targets write heavy use cases hence maintaining data
table and single index table in same region server prevents network overhead
during writes.

If you want to create a separate hbase table for each index table, you can
create global indexes(create index command without 'LOCAL' work creates
global indexes) that are targeted for read heavy use cases.




--
View this message in context: http://apache-phoenix-user-list.1124778.n5.nabble.com/For-multiple-local-indexes-on-Phoenix-table-only-one-local-index-table-is-being-created-in-HBase-tp1995p1999.html
Sent from the Apache Phoenix User List mailing list archive at Nabble.com.

Re: For multiple local indexes on Phoenix table only one local index table is being created in HBase

Posted by Vamsi Krishna <va...@gmail.com>.
Thanks Ankit.

On Wed, Jun 29, 2016 at 12:11 PM Ankit Singhal <an...@gmail.com>
wrote:

> Hi Vamsi,
>
> Phoenix uses single local Index table for all the local indexes created on
> a particular data table.
> Rows are differentiated by local index sequence id and filtered when
> requested during the query for particular index.
>
> Regards,
> Ankit Singhal
>
> Re
>
> On Tue, Jun 28, 2016 at 4:18 AM, Vamsi Krishna <va...@gmail.com>
> wrote:
>
>> Team,
>>
>> I'm using HDP 2.3.2 (HBase : 1.1.2, Phoenix : 4.4.0).
>> *Question:* For multiple local indexes on Phoenix table only one local
>> index table is being created in HBase. Is this regular behavior? Can
>> someone explain why?
>>
>> Phoenix:
>> CREATE TABLE IF NOT EXISTS VAMSI.TABLE_B (COL1 VARCHAR(36) , COL2
>> VARCHAR(36) , COL3 VARCHAR(36) CONSTRAINT TABLE_B_PK PRIMARY KEY (COL1))
>> COMPRESSION='SNAPPY', SALT_BUCKETS=5;
>> CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL2 ON VAMSI.TABLE_A (COL2);
>> CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL3 ON VAMSI.TABLE_A (COL3);
>>
>> hbase(main):012:0> list '_LOCAL.*'
>> TABLE
>> _LOCAL_IDX_VAMSI.TABLE_A
>>
>> Thanks,
>> Vamsi Attluri
>> --
>> Vamsi Attluri
>>
>
> --
Vamsi Attluri

Re: For multiple local indexes on Phoenix table only one local index table is being created in HBase

Posted by Ankit Singhal <an...@gmail.com>.
Hi Vamsi,

Phoenix uses single local Index table for all the local indexes created on
a particular data table.
Rows are differentiated by local index sequence id and filtered when
requested during the query for particular index.

Regards,
Ankit Singhal

Re

On Tue, Jun 28, 2016 at 4:18 AM, Vamsi Krishna <va...@gmail.com>
wrote:

> Team,
>
> I'm using HDP 2.3.2 (HBase : 1.1.2, Phoenix : 4.4.0).
> *Question:* For multiple local indexes on Phoenix table only one local
> index table is being created in HBase. Is this regular behavior? Can
> someone explain why?
>
> Phoenix:
> CREATE TABLE IF NOT EXISTS VAMSI.TABLE_B (COL1 VARCHAR(36) , COL2
> VARCHAR(36) , COL3 VARCHAR(36) CONSTRAINT TABLE_B_PK PRIMARY KEY (COL1))
> COMPRESSION='SNAPPY', SALT_BUCKETS=5;
> CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL2 ON VAMSI.TABLE_A (COL2);
> CREATE LOCAL INDEX IF NOT EXISTS IDX_TABLE_A_COL3 ON VAMSI.TABLE_A (COL3);
>
> hbase(main):012:0> list '_LOCAL.*'
> TABLE
> _LOCAL_IDX_VAMSI.TABLE_A
>
> Thanks,
> Vamsi Attluri
> --
> Vamsi Attluri
>