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

Alex Batyrshin updated PHOENIX-6278:
------------------------------------
    Description: 
This is just a proof of concept. So quite dirty hack for ScanRanges presented.

Feature adds new table options *SALT_COLS* that define how many first columns 
(i.e. key prefix) from composite key to salt.

Should be useful for event logs tables with salt buckets when performing query 
by first columns from key.

Example
{code:java}
CREATE TABLE user_event (
    user VARCHAR NOT NULL,
    type INTEGER NOT NULL
    CONSTRAINT PK PRIMARY KEY (user, type)
) SALT_BUCKETS=10, SALT_COLS=1;

SELECT * FROM user_event WHERE user = ?;{code}
My tests on 4.4bn rows table with SALT_BUCKETS=30 shows up to 10x performance 
boost.

  was:
This is just a proof of concept. So quite dirty hack for ScanRanges presented.

Feature adds new table options *SALT_COLS* that define how many first columns 
(i.e. key prefix) from composite key to salt.

Should be useful for event logs tables with salt buckets when performing query 
by first columns from key.

Example
{code:java}
CREATE TABLE user_event (
    user VARCHAR NOT NULL,
    type INTEGER NOT NULL
    CONSTRAINT PK PRIMARY KEY (user, type)
);

SELECT * FROM user_event WHERE user = ?;{code}

My tests on 4.4bn rows table with SALT_BUCKETS=30 shows up to 10x performance 
boost.


> [POC] Ability to salt only first N columns from composite primary key
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-6278
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6278
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Alex Batyrshin
>            Priority: Major
>             Fix For: 4.x
>
>         Attachments: PHOENIX-6278.4.x.001.patch
>
>
> This is just a proof of concept. So quite dirty hack for ScanRanges presented.
> Feature adds new table options *SALT_COLS* that define how many first columns 
> (i.e. key prefix) from composite key to salt.
> Should be useful for event logs tables with salt buckets when performing 
> query by first columns from key.
> Example
> {code:java}
> CREATE TABLE user_event (
>     user VARCHAR NOT NULL,
>     type INTEGER NOT NULL
>     CONSTRAINT PK PRIMARY KEY (user, type)
> ) SALT_BUCKETS=10, SALT_COLS=1;
> SELECT * FROM user_event WHERE user = ?;{code}
> My tests on 4.4bn rows table with SALT_BUCKETS=30 shows up to 10x performance 
> boost.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to