reference:
Phoenix integration with HBase data analysis
HBase cause of slow queries investigation
Execute the following statement in DBeaver in:
select * from ASSET_NORMAL WHERE ASSET_ID='19-1151444153020846080';
returned messages:
3d8f2cf978094a47b2f24dea58fa697c 19 - 1,151,444,153,020,846,080 computers 1001005 information equipment 1001005002 ......
as follows:
Execute the following statement in DBeaver in:
select count(*) from ASSET_NORMAL;
returned messages:
10,614
as follows:
Execute the following statement in DBeaver in:
explain select count(*) from ASSET_NORMAL;
returned messages:
CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER IDX_ASSET_NORMAL SERVER FILTER BY FIRST KEY ONLY SERVER AGGREGATE INTO SINGLE ROW CLIENT 200 ROW LIMIT
as follows:
Execute the following statement in DBeaver in:
explain select * from ASSET_NORMAL WHERE ASSET_ID='19-1151444153020846080';
returned messages:
CLIENT 1-CHUNK 200 ROWS 177000 BYTES SERIAL 1-WAY ROUND ROBIN RANGE SCAN OVER IDX_ASSET_NORMAL ['19-1151444153020846080'] 177000 200 0 SERVER FILTER BY FIRST KEY ONLY 177000 200 0 SERVER 200 ROW LIMIT 177000 200 0 CLIENT 200 ROW LIMIT 177000 200 0
如下:
直接通过Bash进行操作,执行下列语句:
select count(*) from ASSET_NORMAL;
耗时0.071s,返回如下信息:
0: jdbc:phoenix:node3:2181:/hbase> select count(*) from ASSET_NORMAL; +-----------+ | COUNT(1) | +-----------+ | 11286 | +-----------+ 1 row selected (0.071 seconds)
执行下列语句:
explain select count(*) from ASSET_NORMAL;
耗时0.03s,返回如下信息:
0: jdbc:phoenix:node3:2181:/hbase> explain select count(*) from ASSET_NORMAL; +----------------------------------------------------------------+-----------------+----------------+--------------+ | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | +----------------------------------------------------------------+-----------------+----------------+--------------+ | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER IDX_ASSET_NORMAL | null | null | null | | SERVER FILTER BY FIRST KEY ONLY | null | null | null | | SERVER AGGREGATE INTO SINGLE ROW | null | null | null | +----------------------------------------------------------------+-----------------+----------------+--------------+ 3 rows selected (0.03 seconds)