phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Heather <james.heat...@mendeley.com>
Subject Re: Explain plan over primary key column
Date Wed, 30 Sep 2015 14:28:12 GMT
Yup

On 30/09/15 15:25, Sumit Nigam wrote:
> Thanks James.
>
> So, if I did a range lookup like - EXPLAIN SELECT ID FROM EXP WHERE ID 
> > 5 AND ID < 10
>  then I get  .... RANGE SCAN OVER EXP [6] - [10]
>
> Is that indication enough that PK/ index is used?
>
> ------------------------------------------------------------------------
> *From:* James Heather <james.heather@mendeley.com>
> *To:* user@phoenix.apache.org
> *Sent:* Wednesday, September 30, 2015 7:49 PM
> *Subject:* Re: Explain plan over primary key column
>
> You're asking for every single row of the table, so nothing's going to 
> avoid a full scan. The index wouldn't help.
>
>
>
> On 30/09/15 15:18, Sumit Nigam wrote:
>> Hi,
>>
>> I have a table as:
>>
>> CREATE TABLE EXP (ID BIGINT NOT NULL PRIMARY KEY, TEXT VARCHAR);
>>
>> If I explain the select:
>>
>> EXPLAIN SELECT ID FROM EXP;
>>
>> Then it shows CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER EXP ....
>>
>> I assume it still uses rowkey. Or is it should have shown using 
>> rowkey in explain plan?
>>
>> Also, is it a good idea to declare VARCHAR(n) vs plain VARCHAR? Does 
>> it save some space?
>>
>> Thanks,
>> Sumit
>
>
>


Mime
View raw message