[ 
https://issues.apache.org/jira/browse/PHOENIX-1579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14280123#comment-14280123
 ] 

Rajeshbabu Chintaguntla commented on PHOENIX-1579:
--------------------------------------------------

The reason for timeout is like scanning both index and data table only. Other 
than that I didn't see any problems. I think number of matching records might 
be too high and for each record we need to go to data table then we end up lot 
of disc reads because the data table rows from index table are not in sorted 
order(block cache will be not be used properly).
Can you try some tuning(http://phoenix.apache.org/tuning.html) mainly making 
use of guide posts to increase parallelization(but if the query reqires point 
look up then guide posts will not be used). 
(or) you can include the columns to index so we need not go contact data 
table(in such case better to use global index).

> Query using local index is timing out
> -------------------------------------
>
>                 Key: PHOENIX-1579
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1579
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.2.1, 4.2.2
>         Environment: ubuntu 
> HBase 0.98.7
> Hadoop 2.5.1
> OS: ubuntu
>            Reporter: wuchengzhi
>            Priority: Critical
>
> 1. crate a table by the schema as below:
> CREATE TABLE IF NOT EXISTS Miss_data_table(
> a BIGINT NOT NULL,
> b VARCHAR,
> c INTEGER,
> d INTEGER,
> e INTEGER,
> f INTEGER,
> g VARCHAR,
> h VARCHAR,
> i INTEGER,
> j VARCHAR,
> k INTEGER,
> l VARCHAR,
> m VARCHAR,
> n INTEGER,
> o INTEGER,
> p VARCHAR,
> q VARCHAR,
> r INTEGER,
> s BIGINT,
> t VARCHAR CONSTRAINT pk PRIMARY KEY(a))
> 2.create local index for the table with column: q
> create local index idx_q on Miss_data_table (q);
> 3.upsert data into table.
> upsert into Miss_data_table 
> values(96660688,'hello/TEST-0',156,-1,-1,0,'2013-02-14 
> 18:34:05.0','TEST-1',0,'495839182',0,'50','',0,0,'1818378','102218',0,26,'20141201')
> 4. execute querys...
> select a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t from Miss_data_table where q = 
> '102218';
> +----------+--------------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+------+------+----------+
> | A        | B            | C    | D    | E    | F    | G    | H    | I    | 
> J    | K    | L    | M    | N    | O    | P    | Q      | R    | S    | T     
>    |
> +----------+--------------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+------+------+----------+
> | 96660688 | hello/TEST-0 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 
> NULL | NULL | NULL | NULL | NULL | NULL | NULL | 102218 | NULL | 26   | 
> 20141201 |
> +----------+--------------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+--------+------+------+----------+
> select a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t from Miss_data_table where 
> a=96660688;
> +----------+--------------+------+------+------+------+-----------------------+--------+------+-----------+------+------+------+------+------+---------+--------+------+------+----------+
> | A        | B            | C    | D    | E    | F    | G                     
> | H      | I    | J         | K    | L    | M    | N    | O    | P       | Q  
>     | R    | S    | T        |
> +----------+--------------+------+------+------+------+-----------------------+--------+------+-----------+------+------+------+------+------+---------+--------+------+------+----------+
> | 96660688 | hello/TEST-0 | 156  | -1   | -1   | 0    | 2013-02-14 18:34:05.0 
> | TEST-1 | 0    | 495839182 | 0    | 50   | NULL | 0    | 0    | 1818378 | 
> 102218 | 0    | 26   | 20141201 |
> +----------+--------------+------+------+------+------+-----------------------+--------+------+-----------+------+------+------+------+------+---------+--------+------+------+----------+
> // execute the query plain ,it shows we fetch data by local index.
> explain select a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t from Miss_data_table 
> where q = '102218';
> +------------------------------------------+
> |                   PLAN                   |
> +------------------------------------------+
> | CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER 
> _LOCAL_IDX_TEST.MISS_DATA_TABLE [-32768,'102218'] |
> | CLIENT MERGE SORT                        |
> +------------------------------------------+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to