赞
踩
0: jdbc:phoenix:bigdata:2181> create table bigdata.salt
. . . . . . . . . . . . . . > (id integer primary key,
. . . . . . . . . . . . . . > name varchar,
. . . . . . . . . . . . . . > age integer,
. . . . . . . . . . . . . . > address varchar)
. . . . . . . . . . . . . . > salt_buckets = 20;
No rows affected (4.409 seconds)
hbase(main):002:0> describe 'BIGDATA:SALT'
Table BIGDATA:SALT is ENABLED
BIGDATA:SALT, {TABLE_ATTRIBUTES => {coprocessor$1 => '|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 => '|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|805306366|', coprocessor$3 => '|org.apac
he.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', coprocessor$4 => '|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|805306366|', coprocessor$5 => '|org.apache.phoenix.hbase.index.Indexer|805306366|org.apache.hadoop
.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec,index.builder=org.apache.phoenix.index.PhoenixIndexBuilder'}
COLUMN FAMILIES DESCRIPTION
{NAME => '0', BLOOMFILTER => 'NONE', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'FAST_DIFF', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '
65536', REPLICATION_SCOPE => '0'}
1 row(s) in 0.0760 seconds
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.salt values (1,'hadoop1',18,'北京');
1 row affected (0.036 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.salt values (2,'hadoop2',19,'上海');
1 row affected (0.012 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.salt values (3,'hadoop3',17,'杭州');
1 row affected (0.011 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.salt values (4,'hadoop4',12,'深圳');
1 row affected (0.026 seconds)
Global Indexes
Global indexing targets read heavy uses cases. With global indexes, all the performance penalties for indexes occur at write time. We intercept the data table updates on write (DELETE, UPSERT VALUES and UPSERT SELECT), build the index update and then sent any necessary updates to all interested index tables. At read time, Phoenix will select the index table to use that will produce the fastest query time and directly scan it just like any other HBase table. An index will not be used for a query that references a column that isn’t part of the index.
0: jdbc:phoenix:bigdata:2181> create table bigdata.global_index
. . . . . . . . . . . . . . > (id integer primary key,
. . . . . . . . . . . . . . > name varchar,
. . . . . . . . . . . . . . > age integer,
. . . . . . . . . . . . . . > address varchar)
. . . . . . . . . . . . . . > salt_buckets = 20;
No rows affected (4.344 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.global_index values (1,'hadoop1',18,'北京');
1 row affected (0.007 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.global_index values (2,'hadoop2',19,'上海');
1 row affected (0.006 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.global_index values (3,'hadoop3',17,'杭州');
1 row affected (0.006 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.global_index values (4,'hadoop4',12,'深圳');
1 row affected (0.004 seconds)
0: jdbc:phoenix:bigdata:2181> CREATE INDEX global_index_idx ON bigdata.global_index(name,age);
4 rows affected (9.312 seconds)
hbase(main):003:0> list TABLE BIGDATA:GLOBAL_INDEX BIGDATA:GLOBAL_INDEX_IDX BIGDATA:SALT SYSTEM:CATALOG SYSTEM:FUNCTION SYSTEM:LOG SYSTEM:MUTEX SYSTEM:SEQUENCE SYSTEM:STATS 9 row(s) in 0.0110 seconds => ["BIGDATA:GLOBAL_INDEX", "BIGDATA:GLOBAL_INDEX_IDX", "BIGDATA:SALT", "SYSTEM:CATALOG", "SYSTEM:FUNCTION", "SYSTEM:LOG", "SYSTEM:MUTEX", "SYSTEM:SEQUENCE", "SYSTEM:STATS"] hbase(main):004:0> scan 'BIGDATA:GLOBAL_INDEX_IDX' ROW COLUMN+CELL \x01hadoop2\x00\xC1\x14\x00\x80\x00\x00\x02 column=0:\x00\x00\x00\x00, timestamp=1612843905504, value=x \x05hadoop3\x00\xC1\x12\x00\x80\x00\x00\x03 column=0:\x00\x00\x00\x00, timestamp=1612843905505, value=x \x0Ahadoop1\x00\xC1\x13\x00\x80\x00\x00\x01 column=0:\x00\x00\x00\x00, timestamp=1612843905511, value=x \x0Ehadoop4\x00\xC1\x0D\x00\x80\x00\x00\x04 column=0:\x00\x00\x00\x00, timestamp=1612843905512, value=x 4 row(s) in 0.1330 seconds
0: jdbc:phoenix:bigdata:2181> !tables +------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+ | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_GENERATION | INDEX_STATE | IMMUTABLE_ROWS | SALT_BUCKETS | MULTI_TENANT | VIEW_STATEMENT | VIEW_TYPE | INDEX_ | +------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+ | | BIGDATA | GLOBAL_INDEX_IDX | INDEX | | | | | ACTIVE | false | 20 | false | | | GLOBAL | | | SYSTEM | CATALOG | SYSTEM TABLE | | | | | | false | null | false | | | | | | SYSTEM | FUNCTION | SYSTEM TABLE | | | | | | false | null | false | | | | | | SYSTEM | LOG | SYSTEM TABLE | | | | | | true | 32 | false | | | | | | SYSTEM | SEQUENCE | SYSTEM TABLE | | | | | | false | null | false | | | | | | SYSTEM | STATS | SYSTEM TABLE | | | | | | false | null | false | | | | | | BIGDATA | GLOBAL_INDEX | TABLE | | | | | | false | 20 | false | | | | | | BIGDATA | SALT | TABLE | | | | | | false | 20 | false | | | | +------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+ 0: jdbc:phoenix:bigdata:2181> select * from BIGDATA.GLOBAL_INDEX_IDX . . . . . . . . . . . . . . > ; +----------+--------+------+ | 0:NAME | 0:AGE | :ID | +----------+--------+------+ | hadoop2 | 19 | 2 | | hadoop3 | 17 | 3 | | hadoop1 | 18 | 1 | | hadoop4 | 12 | 4 | +----------+--------+------+ 4 rows selected (0.089 seconds)
0: jdbc:phoenix:bigdata:2181> explain select * from bigdata.global_index;
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN FULL SCAN OVER BIGDATA:GLOBAL_INDEX | null | null | null |
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
0: jdbc:phoenix:bigdata:2181> explain select * from bigdata.global_index where name = 'hadoop1';
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN FULL SCAN OVER BIGDATA:GLOBAL_INDEX | null | null | null |
| SERVER FILTER BY NAME = 'hadoop1' | null | null | null |
+----------------------------------------------------------------------------------+-----------------+----------------+--------------+
2 rows selected (0.03 seconds)
0: jdbc:phoenix:bigdata:2181> explain select /*+ INDEX(bigdata.global_index global_index_idx) */ * from bigdata.global_index where name = 'hadoop1';
+------------------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+------------------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN FULL SCAN OVER BIGDATA:GLOBAL_INDEX | null | null | null |
| SKIP-SCAN-JOIN TABLE 0 | null | null | null |
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:GLOBAL_INDEX_IDX [0,'hadoop1'] - [19,'hadoop1'] | null | null | null |
| SERVER FILTER BY FIRST KEY ONLY | null | null | null |
| DYNAMIC SERVER FILTER BY "BIGDATA.GLOBAL_INDEX.ID" IN ($11.$13) | null | null | null |
+------------------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
5 rows selected (0.049 seconds)
0: jdbc:phoenix:bigdata:2181> explain select age from bigdata.global_index where name = 'hadoop1'; +----------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | +----------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:GLOBAL_INDEX_IDX [0,'hadoop1'] - [19,'hadoop1'] | null | null | null | | SERVER FILTER BY FIRST KEY ONLY | null | null | null | +----------------------------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ 2 rows selected (0.034 seconds) 0: jdbc:phoenix:bigdata:2181> explain select name from bigdata.global_index where age = 18; +--------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | +--------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:GLOBAL_INDEX_IDX [0] - [19] | null | null | null | | SERVER FILTER BY FIRST KEY ONLY AND TO_INTEGER("AGE") = 18 | null | null | null | +--------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ 2 rows selected (0.027 seconds)
Local Indexes
Local indexing targets write heavy, space constrained use cases. Just like with global indexes, Phoenix will automatically select whether or not to use a local index at query-time. With local indexes, index data and table data co-reside on same server preventing any network overhead during writes. Local indexes can be used even when the query isn’t fully covered (i.e. Phoenix automatically retrieve the columns not in the index through point gets against the data table). Unlike global indexes, all local indexes of a table are stored in a single, separate shared table prior to 4.8.0 version. From 4.8.0 onwards we are storing all local index data in the separate shadow column families in the same data table. At read time when the local index is used, every region must be examined for the data as the exact region location of index data cannot be predetermined. Thus some overhead occurs at read-time.
0: jdbc:phoenix:bigdata:2181> create table bigdata.local_index
. . . . . . . . . . . . . . > (id integer primary key,
. . . . . . . . . . . . . . > name varchar,
. . . . . . . . . . . . . . > age integer,
. . . . . . . . . . . . . . > address varchar)
. . . . . . . . . . . . . . > salt_buckets = 20;
No rows affected (4.358 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.local_index values (1,'hadoop1',18,'北京');
1 row affected (0.008 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.local_index values (2,'hadoop2',19,'上海');
1 row affected (0.008 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.local_index values (3,'hadoop3',17,'杭州');
1 row affected (0.007 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.local_index values (4,'hadoop4',12,'深圳');
1 row affected (0.005 seconds)
0: jdbc:phoenix:bigdata:2181> CREATE LOCAL INDEX local_index_idx ON bigdata.local_index(name,age);
4 rows affected (11.532 seconds)
hbase(main):006:0> describe 'BIGDATA:LOCAL_INDEX' Table BIGDATA:LOCAL_INDEX is ENABLED BIGDATA:LOCAL_INDEX, {TABLE_ATTRIBUTES => {coprocessor$1 => '|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 => '|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|805306366|', coprocessor$3 => '|o rg.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', coprocessor$4 => '|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|805306366|', coprocessor$5 => '|org.apache.phoenix.hbase.index.Indexer|805306366|org.apache .hadoop.hbase.index.codec.class=org.apache.phoenix.index.PhoenixIndexCodec,index.builder=org.apache.phoenix.index.PhoenixIndexBuilder', coprocessor$6 => '|org.apache.hadoop.hbase.regionserver.IndexHalfStoreFileReaderGenerator|805306366|', ME TADATA => {'DATA_TABLE_NAME' => 'BIGDATA.LOCAL_INDEX', 'SPLIT_POLICY' => 'org.apache.phoenix.hbase.index.IndexRegionSplitPolicy'}} COLUMN FAMILIES DESCRIPTION {NAME => '0', BLOOMFILTER => 'NONE', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'FAST_DIFF', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => ' 65536', REPLICATION_SCOPE => '0'} {NAME => 'L#0', BLOOMFILTER => 'NONE', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'FAST_DIFF', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 2 row(s) in 0.0310 seconds
0: jdbc:phoenix:bigdata:2181> !tables
+------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_GENERATION | INDEX_STATE | IMMUTABLE_ROWS | SALT_BUCKETS | MULTI_TENANT | VIEW_STATEMENT | VIEW_TYPE | INDEX_ |
+------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+
| | BIGDATA | GLOBAL_INDEX_IDX | INDEX | | | | | ACTIVE | false | 20 | false | | | GLOBAL |
| | BIGDATA | LOCAL_INDEX_IDX | INDEX | | | | | ACTIVE | false | null | false | | | LOCAL |
| | SYSTEM | CATALOG | SYSTEM TABLE | | | | | | false | null | false | | | |
| | SYSTEM | FUNCTION | SYSTEM TABLE | | | | | | false | null | false | | | |
| | SYSTEM | LOG | SYSTEM TABLE | | | | | | true | 32 | false | | | |
| | SYSTEM | SEQUENCE | SYSTEM TABLE | | | | | | false | null | false | | | |
| | SYSTEM | STATS | SYSTEM TABLE | | | | | | false | null | false | | | |
| | BIGDATA | GLOBAL_INDEX | TABLE | | | | | | false | 20 | false | | | |
| | BIGDATA | LOCAL_INDEX | TABLE | | | | | | false | 20 | false | | | |
| | BIGDATA | SALT | TABLE | | | | | | false | 20 | false | | | |
+------------+--------------+-------------------+---------------+----------+------------+----------------------------+-----------------+--------------+-----------------+---------------+---------------+-----------------+------------+--------+
0: jdbc:phoenix:bigdata:2181> select * from BIGDATA.LOCAL_INDEX_IDX;
+----------+--------+------+
| 0:NAME | 0:AGE | :ID |
+----------+--------+------+
| hadoop4 | 12 | 4 |
| hadoop3 | 17 | 3 |
| hadoop2 | 19 | 2 |
| hadoop1 | 18 | 1 |
+----------+--------+------+
4 rows selected (0.043 seconds)
0: jdbc:phoenix:bigdata:2181> explain select * from bigdata.local_index;
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN FULL SCAN OVER BIGDATA:LOCAL_INDEX | null | null | null |
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
1 row selected (0.025 seconds)
0: jdbc:phoenix:bigdata:2181> explain select * from bigdata.local_index where name = 'hadoop1';
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN FULL SCAN OVER BIGDATA:LOCAL_INDEX | null | null | null |
| SERVER FILTER BY NAME = 'hadoop1' | null | null | null |
+---------------------------------------------------------------------------------+-----------------+----------------+--------------+
0: jdbc:phoenix:bigdata:2181> explain select address from bigdata.local_index where name = 'hadoop1'; +------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | +------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:LOCAL_INDEX [1,'hadoop1'] | null | null | null | | SERVER FILTER BY FIRST KEY ONLY | null | null | null | +------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+ 2 rows selected (0.039 seconds) 0: jdbc:phoenix:bigdata:2181> explain select address from bigdata.local_index where age = 18; +--------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | +--------------------------------------------------------------------------------------+-----------------+----------------+--------------+ | CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:LOCAL_INDEX [1] | null | null | null | | SERVER FILTER BY FIRST KEY ONLY AND TO_INTEGER("AGE") = 18 | null | null | null | +--------------------------------------------------------------------------------------+-----------------+----------------+--------------+ 2 rows selected (0.025 seconds
Phoenix is particularly powerful in that we provide covered indexes - we do not need to go back to the primary table once we have found the index entry. Instead, we bundle the data we care about right in the index rows, saving read-time overhead.
For example, the following would create an index on the v1 and v2 columns and include the v3 column in the index as well to prevent having to get it from the data table:
CREATE INDEX my_index ON my_table (v1,v2) INCLUDE(v3)
0: jdbc:phoenix:bigdata:2181> create table bigdata.covered_index
. . . . . . . . . . . . . . > (id integer primary key,
. . . . . . . . . . . . . . > name varchar,
. . . . . . . . . . . . . . > age integer,
. . . . . . . . . . . . . . > address varchar)
. . . . . . . . . . . . . . > salt_buckets = 20;
No rows affected (2.329 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.covered_index values (1,'hadoop1',18,'北京');
1 row affected (0.009 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.covered_index values (2,'hadoop2',19,'上海');
1 row affected (0.006 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.covered_index values (3,'hadoop3',17,'杭州');
1 row affected (0.011 seconds)
0: jdbc:phoenix:bigdata:2181> upsert into bigdata.covered_index values (4,'hadoop4',12,'深圳');
1 row affected (0.006 seconds)
0: jdbc:phoenix:bigdata:2181> CREATE INDEX covered_index_idx ON bigdata.covered_index(name,age) INCLUDE(address);
4 rows affected (7.271 seconds)
hbase(main):006:0> describe 'BIGDATA:COVERED_INDEX_IDX'
Table BIGDATA:COVERED_INDEX_IDX is ENABLED
BIGDATA:COVERED_INDEX_IDX, {TABLE_ATTRIBUTES => {coprocessor$1 => '|org.apache.phoenix.coprocessor.ScanRegionObserver|805306366|', coprocessor$2 => '|org.apache.phoenix.coprocessor.UngroupedAggregateRegionObserver|805306366|', coprocessor$3
=> '|org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver|805306366|', coprocessor$4 => '|org.apache.phoenix.coprocessor.ServerCachingEndpointImpl|805306366|', METADATA => {'DATA_TABLE_NAME' => 'BIGDATA.COVERED_INDEX', 'PRIORITY' =>
'1000'}}
COLUMN FAMILIES DESCRIPTION
{NAME => '0', BLOOMFILTER => 'NONE', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'FAST_DIFF', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '
65536', REPLICATION_SCOPE => '0'}
1 row(s) in 0.0240 seconds
0: jdbc:phoenix:bigdata:2181> select * from BIGDATA.COVERED_INDEX_IDX;
+----------+--------+------+------------+
| 0:NAME | 0:AGE | :ID | 0:ADDRESS |
+----------+--------+------+------------+
| hadoop2 | 19 | 2 | 上海 |
| hadoop3 | 17 | 3 | 杭州 |
| hadoop1 | 18 | 1 | 北京 |
| hadoop4 | 12 | 4 | 深圳 |
+----------+--------+------+------------+
4 rows selected (0.054 seconds)
0: jdbc:phoenix:bigdata:2181> explain select address from bigdata.covered_index where age = 18;
+---------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
| PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
+---------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
| CLIENT 20-CHUNK PARALLEL 20-WAY ROUND ROBIN RANGE SCAN OVER BIGDATA:COVERED_INDEX_IDX [0] - [19] | null | null | null |
| SERVER FILTER BY TO_INTEGER("AGE") = 18 | null | null | null |
+---------------------------------------------------------------------------------------------------+-----------------+----------------+--------------+
2 rows selected (0.021 seconds)
CREATE INDEX async_index ON my_schema.my_table (v) ASYNC
${HBASE_HOME}/bin/hbase
org.apache.phoenix.mapreduce.index.IndexTool
--schema MY_SCHEMA
--data-table MY_TABLE
--index-table ASYNC_IDX
--output-path ASYNC_IDX_HFILES
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。