Created 04-03-2017 01:46 PM
We are using phoenix layer on top of Hbase table & created hbase tables via phoenix and appied snappy compression . is it possible to apply snappy compression or any compression on phoenix seconday index tables also ? if yes ,could you please share the syntax to use . Thanks .
Created 04-03-2017 02:25 PM
The secondary table is just another table in HBase that you have created. You can compress it using same technique you used to compress your data table.
Created 04-03-2017 02:44 PM
Thanks @mqureshi . can we add 'snappy compression' with alter phoenix command ? if yes , could please provide the syntax for it . Thanks you .
Created 04-03-2017 02:52 PM
I am not sure if you can add that by using Phoenix. But using HBase shell, you can first enable compression for the table and then run "major compact <table name>"
Created 04-03-2017 08:29 PM
While creating a new secondary index for a table, we can use the command such as below to specify the compression type:
> create index INDEXNAME on SCHEMA.TABLENAME(COLUMN) COMPRESSION=snappy;
And to alter the compression for an existing index table, run the following command from phoenix (notice that the command is 'alter table' instead of alter index here)
> alter table SCHEMA.INDEXNAME SET COMPRESSION=snappy
Created 04-04-2017 05:18 AM
Thanks @rmaruthiyodan . Please provide some more clarity for your reply . you have given 'alter table' instead of 'alter index', that is fine . you mentioned SCHEMA.INDEXNAME ,SCHEMA is related to table as i knew , Is it related to index s well ? I dont have ant SCHEMA for the table ,what will bethe default SCHEMA name ? Thanks
Created 05-02-2017 02:42 AM
@srini Sorry, I missed to notice this question earlier. Yes, the schema is related to an index as well. If no schema is associated with a table then you would just use the table name or index name in the command as:
> alter table INDEXNAME SET COMPRESSION=snappy;
I hope that answers the question.