phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Batyrshin (Jira)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-6278) [POC] Ability to salt only first N columns from composite primary key
Date Wed, 23 Dec 2020 23:17:00 GMT
Alex Batyrshin created PHOENIX-6278:
---------------------------------------

             Summary: [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
             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)
);

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)

Mime
View raw message