You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/01/23 20:52:39 UTC

[jira] [Updated] (PHOENIX-2548) Local Indexing Not Looks Like Working As Expected

     [ https://issues.apache.org/jira/browse/PHOENIX-2548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Taylor updated PHOENIX-2548:
----------------------------------
    Assignee: Rajeshbabu Chintaguntla

> Local Indexing Not Looks Like Working As Expected
> -------------------------------------------------
>
>                 Key: PHOENIX-2548
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2548
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.2
>            Reporter: Gokhan Cagrici
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Critical
>
> Hi,
> We are accessing this table using a variety of different WHERE clauses and for each of them, we are trying to create an appropriate index to avoid full table scan. Since there is going to be almost 20 indexes, we tried to proceed with local indexing since there will be a lot of writes.
> Here is the table definition:
> CREATE TABLE DEVICEDIM_TYPE1 (
>   TENANT_ID VARCHAR NOT NULL,
>   DEVICE_TYPE1_KEY BIGINT NOT NULL,
>   CLASSNAME VARCHAR(64),
>   DAY_IN_MONTH SMALLINT,
>   MONTH_NUMBER SMALLINT,
>   QUARTER_NUMBER SMALLINT,
>   YEAR SMALLINT,
>   WEEK_NUMBER SMALLINT,
>   YEAR_FOR_WEEK SMALLINT,
>   HOUR SMALLINT,
>   MINUTE SMALLINT,
>   IPADDRESS VARCHAR(50),
>   DEVICENAME VARCHAR(255),
>   MACADDRESS VARCHAR(30),
>   CONSTRAINT PK PRIMARY KEY (TENANT_ID, DEVICE_TYPE1_KEY)
> ) SALT_BUCKETS=4, COMPRESSION='GZ', VERSIONS=1, MULTI_TENANT=TRUE;
> And here is the index:
> create local index gokhan_ix2 on devicedim_type1 (devicename, macaddress)
> Now if I execute this:
> explain select devicename from devicedim_type1 where tenant_id = 'ccd' and devicename = 'abc' and macaddress = 'afg'
> Here is the output:
> CLIENT 4-CHUNK PARALLEL 4-WAY RANGE SCAN OVER DEVICEDIM_TYPE1 [0,'ccd']
>     SERVER FILTER BY (DEVICENAME = 'abc' AND MACADDRESS = 'afg')
>     SERVER 100 ROW LIMIT
> CLIENT 100 ROW LIMIT
> I was expecting the index to be used. Am I wrong?



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