why sort_columns?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

why sort_columns?

孙而焓
hi community,
   
since we already have many rmdb sqls scripts,we don't want to change them too much when migrating to carbon.
suppose we already have sql script like:
   "create table (c1,c2,...c7")",
If we want to change column order to shift most often used column ahead when query data,i think it's better change it this way like:
  "create table(c1,c2,c7,c4..c6,c3)
rather
  "create table(c1...c7) tblproperties('sort_columns' = 'c7,c3')"
because the former way just reordering columns without adding extra settings,which is more readable to thos who is familiar with rmdb but not with carbon.



[hidden email]
孙而焓【FFCS研究院】
Reply | Threaded
Open this post in threaded view
|

Re: why sort_columns?

Liang Chen
Administrator
I have replied this question in another topic session as below :

First, please check this doc: http://carbondata.apache.org/
useful-tips-on-carbondata.html, see if can help you to understand
CarbonData's index usage.

Like you mentioned that 1.2 will introduce sort columns feature to help
users to more easily specify which columns need to build index. for example
: "create table(c1...c7)  tblproperties('sort_columns' = 'c7,c3')".

As you know , before 1.1 CarbonData by default builds MDK index as per the
order of columns in creation table, the feature will be kept in future
versions, so you can still use "create table (c1,c2,...c7")" to build
index.

HTH.

Regards
Liang

2017-05-14 19:31 GMT-07:00 [hidden email] <[hidden email]>:

> hi community,
>
> since we already have many rmdb sqls scripts,we don't want to change them
> too much when migrating to carbon.
> suppose we already have sql script like:
>    "create table (c1,c2,...c7")",
> If we want to change column order to shift most often used column ahead
> when query data,i think it's better change it this way like:
>   "create table(c1,c2,c7,c4..c6,c3)
> rather
>   "create table(c1...c7) tblproperties('sort_columns' = 'c7,c3')"
> because the former way just reordering columns without adding extra
> settings,which is more readable to thos who is familiar with rmdb but not
> with carbon.
>
>
>
> [hidden email]
>



--
Regards
Liang
Reply | Threaded
Open this post in threaded view
|

Re: Re: why sort_columns?

孙而焓
In reply to this post by 孙而焓
I have replied this question in another topic session as below :

First, please check this doc: http://carbondata.apache.org/
useful-tips-on-carbondata.html, see if can help you to understand
CarbonData's index usage.

Like you mentioned that 1.2 will introduce sort columns feature to help
users to more easily specify which columns need to build index. for example
: "create table(c1...c7)  tblproperties('sort_columns' = 'c7,c3')".

As you know , before 1.1 CarbonData by default builds MDK index as per the
order of columns in creation table, the feature will be kept in future
versions, so you can still use "create table (c1,c2,...c7")" to build
index.

HTH.

Regards
Liang

2017-05-14 19:31 GMT-07:00 [hidden email] <[hidden email]>:

> hi community,
>
> since we already have many rmdb sqls scripts,we don't want to change them
> too much when migrating to carbon.
> suppose we already have sql script like:
>    "create table (c1,c2,...c7")",
> If we want to change column order to shift most often used column ahead
> when query data,i think it's better change it this way like:
>   "create table(c1,c2,c7,c4..c6,c3)
> rather
>   "create table(c1...c7) tblproperties('sort_columns' = 'c7,c3')"
> because the former way just reordering columns without adding extra
> settings,which is more readable to thos who is familiar with rmdb but not
> with carbon.
>
>
>
> [hidden email]
>



--
Regards
Liang
孙而焓【FFCS研究院】
Reply | Threaded
Open this post in threaded view
|

Re: why sort_columns?

ravipesala
In reply to this post by 孙而焓
Hi,

You can still use like create table(c1,c2,c7,c4..c6,c3) with out specifying
sort_columns. If you specify like this then it goes to default behavior.
All string, date. timestamp goes to sort_columns in the order you mentioned
in the create table.

Regards,
Ravindra.

On 15 May 2017 at 08:01, [hidden email] <[hidden email]>
wrote:

> hi community,
>
> since we already have many rmdb sqls scripts,we don't want to change them
> too much when migrating to carbon.
> suppose we already have sql script like:
>    "create table (c1,c2,...c7")",
> If we want to change column order to shift most often used column ahead
> when query data,i think it's better change it this way like:
>   "create table(c1,c2,c7,c4..c6,c3)
> rather
>   "create table(c1...c7) tblproperties('sort_columns' = 'c7,c3')"
> because the former way just reordering columns without adding extra
> settings,which is more readable to thos who is familiar with rmdb but not
> with carbon.
>
>
>
> [hidden email]
>



--
Thanks & Regards,
Ravi