Apache Phoenix Performance Result :: Tue Feb 04 03:07:46 PST 2014

Queries by Category


Aggregation

select count(*) from AGGREGATION_TABLE
1.06s PHOENIX-SNAPSHOT

select count(1) from AGGREGATION_TABLE group by HOST
1.04s PHOENIX-SNAPSHOT

select core, count(1) from AGGREGATION_TABLE group by CORE
1.26s PHOENIX-SNAPSHOT

select core, host, sum(ACTIVE_VISITOR) from AGGREGATION_TABLE group by core, host
2.06s PHOENIX-SNAPSHOT

select AVG(DB), MIN(CORE), MAX(ACTIVE_VISITOR) from AGGREGATION_TABLE where host='CS' and DOMAIN<>'Google.com'
2.48s PHOENIX-SNAPSHOT

select round(date, 'day',50), sum(core)+2 from AGGREGATION_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
1.06s PHOENIX-SNAPSHOT

select trunc(date, 'hour', 1000), count(DB), count(ACTIVE_VISITOR) from AGGREGATION_TABLE where feature='Login' and (core<50 or db<20 or active_visitor > 200) group by trunc(date, 'hour', 1000)
1.27s PHOENIX-SNAPSHOT

select count(active_visitor) count from AGGREGATION_TABLE
1.71s PHOENIX-SNAPSHOT

select count(distinct active_visitor) count from AGGREGATION_TABLE
2.04s PHOENIX-SNAPSHOT

select count(core), count(db), count(active_visitor) from AGGREGATION_TABLE
2.23s PHOENIX-SNAPSHOT

select core, count(db) count from AGGREGATION_TABLE group by CORE
1.66s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core < 10 and db < 200
0.93s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core < 10 and active_visitor < 1000
0.77s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core > 90
0.84s PHOENIX-SNAPSHOT

select count(*) from WIDE_PK
2.26s PHOENIX-SNAPSHOT


Aggregation with filter no non-pk

select count(*) from TABLE_6CF where f < 10000
2.15s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF where f < 10000
2.22s PHOENIX-SNAPSHOT

select count(*) from WIDE_PK where column2<10
3.51s PHOENIX-SNAPSHOT

select count(*) from WIDE_PK where column2<50 and column3<50 and column4<50 and column5<50
5s PHOENIX-SNAPSHOT


ColumnFamilies-Single

select count(1) from TABLE_6CF where K1 in ('A', 'B', 'C', 'D')
1.55s PHOENIX-SNAPSHOT

select count(1) from TABLE_6CF where K1 in ('A', 'C')
1.34s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF where f < 1000
1.18s PHOENIX-SNAPSHOT

select a,b,c,d,e,f from TABLE_6CF where B>1000 and B<2000 and f>1000 and f<2000
1.31s PHOENIX-SNAPSHOT

select sum(a),sum(b),sum(c),sum(d) from TABLE_6CF group by K1
4.54s PHOENIX-SNAPSHOT

select count(1) from TABLE_1CF where K1 in ('A', 'B', 'C', 'D')
1.68s PHOENIX-SNAPSHOT

select count(1) from TABLE_1CF where K1 in ('A', 'C')
1.49s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF where f < 1000
1.86s PHOENIX-SNAPSHOT

select a,b,c,d,e,f from TABLE_1CF where B>1000 and B<2000 and f>1000 and f<2000
2.31s PHOENIX-SNAPSHOT

select sum(a),sum(b),sum(c),sum(d) from TABLE_1CF group by K1
3.8s PHOENIX-SNAPSHOT


Count Distinct

select count(distinct core), count(distinct db), count(distinct active_visitor) from AGGREGATION_TABLE
2.81s PHOENIX-SNAPSHOT

select core, count(distinct db) count from AGGREGATION_TABLE group by CORE
2.94s PHOENIX-SNAPSHOT


IN/LIKE Clause

select count(core) from AGGREGATION_TABLE where core IN (1,25,50,75,100)
0.77s PHOENIX-SNAPSHOT

select count(1) from IN_LIKE_TABLE where K1 in ('Z', 'D', 'F', 'X')
0.64s PHOENIX-SNAPSHOT

select * from IN_LIKE_TABLE where K1 in ('A','B') and K2 in ('xxx1000000','xxx2000000','xxx2000001')
0.01s PHOENIX-SNAPSHOT

select * from IN_LIKE_TABLE where K1 in ('A', 'C', 'E', 'F', 'H') and K2 like 'xxxxxx1%'
0.02s PHOENIX-SNAPSHOT

select count(*) from IN_LIKE_TABLE where K1 in ('X','A','B','C','D','E','F','G','H','I','Z') and K2 like '%1%'
1.55s PHOENIX-SNAPSHOT

select count(*) from IN_LIKE_TABLE where (K1 in ('A','E','F','G','H','I','Z') or K1 like 'E%') and (K2 like '%xx1%' or K2 like '%xxxxxx2%')
1.32s PHOENIX-SNAPSHOT


Index

select count(*) from INDEXED_TABLE
1.02s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(*) from INDEXED_TABLE
2.2s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(*) from INDEXED_TABLE
0.9s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(*) from INDEXED_TABLE
1.38s PHOENIX-SNAPSHOT

select round(date, 'day',50), sum(core)+2 from INDEXED_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
0.29s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ round(date, 'day',50), sum(core)+2 from INDEXED_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
1.48s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core IN (1,100)
0.12s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core IN (1,100)
0.08s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core IN (1,100)
0.1s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core IN (1,100)
0.98s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.14s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.15s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.12s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
1.02s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core < 10 and db < 200
0.2s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core < 10 and db < 200
0.66s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core < 10 and db < 200
0.2s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core < 10 and db < 200
1.33s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core < 100 and db < 2000
1.38s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core < 100 and db < 2000
2.83s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core > 90
0.19s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core > 90
1.12s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core > 0
0.95s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core > 0
1.82s PHOENIX-SNAPSHOT

select db from INDEXED_TABLE where db >5 and db <7 order by db
0.08s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ db from INDEXED_TABLE where db >5 and db <7 order by db
1.84s PHOENIX-SNAPSHOT

select db from INDEXED_TABLE order by db limit 10
0.06s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ db from INDEXED_TABLE order by db limit 10
2.47s PHOENIX-SNAPSHOT


Index Creation After Data

CREATE INDEX idx5 ON INDEXED_TABLE (CORE) INCLUDE (DB,ACTIVE_VISITOR)
37.89s PHOENIX-SNAPSHOT


Large Group By

select count(*) from TABLE_6CF group by A
1.69s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF group by B
2.55s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF group by A
1.99s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF group by B
2.48s PHOENIX-SNAPSHOT


Load Data

LOAD DATA AGGREGATION_TABLE [2000000 ROWS]
115.61s PHOENIX-SNAPSHOT

LOAD DATA IN_LIKE_TABLE [2000000 ROWS]
94.7s PHOENIX-SNAPSHOT

LOAD DATA INDEXED_TABLE [2000000 ROWS]
486.5s PHOENIX-SNAPSHOT

LOAD DATA TABLE_6CF [2000000 ROWS]
113.01s PHOENIX-SNAPSHOT

LOAD DATA SALTED_TABLE [2000000 ROWS]
109.65s PHOENIX-SNAPSHOT

LOAD DATA TABLE_1CF [2000000 ROWS]
104.14s PHOENIX-SNAPSHOT

LOAD DATA WIDE_PK [2000000 ROWS]
237.14s PHOENIX-SNAPSHOT


Percentile

select percentile_cont(0.9) within group (order by active_visitor asc) from AGGREGATION_TABLE
2.03s PHOENIX-SNAPSHOT

select percentile_cont(0.1) within group (order by active_visitor desc) from AGGREGATION_TABLE
2.01s PHOENIX-SNAPSHOT

select percentile_cont(0.5) within group (order by core asc), percentile_cont(0.5) within group (order by db asc), percentile_cont(0.5) within group (order by active_visitor asc) from AGGREGATION_TABLE
2.75s PHOENIX-SNAPSHOT

select core, percentile_cont(0.9999) within group (order by db asc) from AGGREGATION_TABLE group by CORE
2.96s PHOENIX-SNAPSHOT


Salting

select count(1) from SALTED_TABLE where K1 in ('A', 'B', 'C', 'D')
1.59s PHOENIX-SNAPSHOT

select count(*) from SALTED_TABLE where D < 1000
0.88s PHOENIX-SNAPSHOT

select avg(c),avg(d) from SALTED_TABLE group by K1
3.32s PHOENIX-SNAPSHOT




Queries by Table



AGGREGATION_TABLE


Table used for various aggregation functions

ROWS 2000000 [2M]

DDL CREATE TABLE $TABLE (HOST CHAR(2) NOT NULL,DOMAIN VARCHAR NOT NULL,FEATURE VARCHAR NOT NULL,DATE DATE NOT NULL,USAGE.CORE BIGINT,USAGE.DB BIGINT,STATS.ACTIVE_VISITOR INTEGER CONSTRAINT PK PRIMARY KEY (HOST, DOMAIN, FEATURE, DATE)) SPLIT ON ('CSGoogle','CSSalesforce','EUApple','EUGoogle','EUSalesforce','NAApple','NAGoogle','NASalesforce')

DATA GENERATOR
STRING :: Values: NA|CS|EU
STRING :: Values: Salesforce.com|Apple.com|Google.com|Yelp.com
STRING :: Values: Login|Report|Dashboard|Sales|UI
DATE :: Values: SEQUENTIAL
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 2000 Values: RANDOM
INTEGER :: Max. Value: 10000 Values: RANDOM

select count(*) from AGGREGATION_TABLE
1.06s PHOENIX-SNAPSHOT

select count(1) from AGGREGATION_TABLE group by HOST
1.04s PHOENIX-SNAPSHOT

select core, count(1) from AGGREGATION_TABLE group by CORE
1.26s PHOENIX-SNAPSHOT

select core, host, sum(ACTIVE_VISITOR) from AGGREGATION_TABLE group by core, host
2.06s PHOENIX-SNAPSHOT

select AVG(DB), MIN(CORE), MAX(ACTIVE_VISITOR) from AGGREGATION_TABLE where host='CS' and DOMAIN<>'Google.com'
2.48s PHOENIX-SNAPSHOT

select round(date, 'day',50), sum(core)+2 from AGGREGATION_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
1.06s PHOENIX-SNAPSHOT

select trunc(date, 'hour', 1000), count(DB), count(ACTIVE_VISITOR) from AGGREGATION_TABLE where feature='Login' and (core<50 or db<20 or active_visitor > 200) group by trunc(date, 'hour', 1000)
1.27s PHOENIX-SNAPSHOT

select count(active_visitor) count from AGGREGATION_TABLE
1.71s PHOENIX-SNAPSHOT

select count(distinct active_visitor) count from AGGREGATION_TABLE
2.04s PHOENIX-SNAPSHOT

select percentile_cont(0.9) within group (order by active_visitor asc) from AGGREGATION_TABLE
2.03s PHOENIX-SNAPSHOT

select percentile_cont(0.1) within group (order by active_visitor desc) from AGGREGATION_TABLE
2.01s PHOENIX-SNAPSHOT

select count(core), count(db), count(active_visitor) from AGGREGATION_TABLE
2.23s PHOENIX-SNAPSHOT

select count(distinct core), count(distinct db), count(distinct active_visitor) from AGGREGATION_TABLE
2.81s PHOENIX-SNAPSHOT

select percentile_cont(0.5) within group (order by core asc), percentile_cont(0.5) within group (order by db asc), percentile_cont(0.5) within group (order by active_visitor asc) from AGGREGATION_TABLE
2.75s PHOENIX-SNAPSHOT

select core, count(db) count from AGGREGATION_TABLE group by CORE
1.66s PHOENIX-SNAPSHOT

select core, count(distinct db) count from AGGREGATION_TABLE group by CORE
2.94s PHOENIX-SNAPSHOT

select core, percentile_cont(0.9999) within group (order by db asc) from AGGREGATION_TABLE group by CORE
2.96s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core IN (1,25,50,75,100)
0.77s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core < 10 and db < 200
0.93s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core < 10 and active_visitor < 1000
0.77s PHOENIX-SNAPSHOT

select count(core) from AGGREGATION_TABLE where core > 90
0.84s PHOENIX-SNAPSHOT

LOAD DATA AGGREGATION_TABLE [2000000 ROWS]
115.61s PHOENIX-SNAPSHOT


IN_LIKE_TABLE


Phoenix 1.2+ uses skip scan that gives significant performance improvement for IN/LIKE queries.

ROWS 2000000 [2M]

DDL CREATE TABLE IF NOT EXISTS $TABLE (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CF.A INTEGER, CF.B VARCHAR, CF.C VARCHAR CONSTRAINT PK PRIMARY KEY (K1,K2)) SPLIT ON ('B','C','D','E','F','G','H','I')

DATA GENERATOR
STRING :: Values: A|B|C|D|E|F|G|H|I
STRING :: Length: 10 Values: SEQUENTIAL
INTEGER :: Max. Value: 1000000 Values: RANDOM
STRING :: Length: 50 Values: RANDOM
STRING :: Length: 50 Values: RANDOM

select count(1) from IN_LIKE_TABLE where K1 in ('Z', 'D', 'F', 'X')
0.64s PHOENIX-SNAPSHOT

select * from IN_LIKE_TABLE where K1 in ('A','B') and K2 in ('xxx1000000','xxx2000000','xxx2000001')
0.01s PHOENIX-SNAPSHOT

select * from IN_LIKE_TABLE where K1 in ('A', 'C', 'E', 'F', 'H') and K2 like 'xxxxxx1%'
0.02s PHOENIX-SNAPSHOT

select count(*) from IN_LIKE_TABLE where K1 in ('X','A','B','C','D','E','F','G','H','I','Z') and K2 like '%1%'
1.55s PHOENIX-SNAPSHOT

select count(*) from IN_LIKE_TABLE where (K1 in ('A','E','F','G','H','I','Z') or K1 like 'E%') and (K2 like '%xx1%' or K2 like '%xxxxxx2%')
1.32s PHOENIX-SNAPSHOT

LOAD DATA IN_LIKE_TABLE [2000000 ROWS]
94.7s PHOENIX-SNAPSHOT


INDEXED_TABLE


Indexing test. Phoenix 2.0+ feature. See explain plan by hovering over version label to see which index table is used.

ROWS 2000000 [2M]

DDL CREATE TABLE $TABLE (HOST CHAR(2) NOT NULL,DOMAIN VARCHAR NOT NULL,FEATURE VARCHAR NOT NULL,DATE DATE NOT NULL,USAGE.CORE BIGINT,USAGE.DB BIGINT,STATS.ACTIVE_VISITOR INTEGER CONSTRAINT PK PRIMARY KEY (HOST, DOMAIN, FEATURE, DATE)) IMMUTABLE_ROWS=true,MAX_FILESIZE=30485760;CREATE INDEX idx1 ON $TABLE (CORE);CREATE INDEX idx2 ON $TABLE (DB);CREATE INDEX idx3 ON $TABLE (DB,ACTIVE_VISITOR);CREATE INDEX idx4 ON $TABLE (CORE,DB,ACTIVE_VISITOR);CREATE INDEX ids1 ON $TABLE (CORE) SALT_BUCKETS=16;CREATE INDEX ids2 ON $TABLE (DB) SALT_BUCKETS=16;CREATE INDEX ids3 ON $TABLE (DB,ACTIVE_VISITOR) SALT_BUCKETS=16;CREATE INDEX ids4 ON $TABLE (CORE,DB,ACTIVE_VISITOR) SALT_BUCKETS=16;

DATA GENERATOR
STRING :: Values: NA|CS|EU
STRING :: Values: Salesforce.com|Apple.com|Google.com|Yelp.com
STRING :: Values: Login|Report|Dashboard|Sales|UI
DATE :: Values: SEQUENTIAL
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 2000 Values: RANDOM
INTEGER :: Max. Value: 10000 Values: RANDOM

select count(*) from INDEXED_TABLE
1.02s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(*) from INDEXED_TABLE
2.2s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(*) from INDEXED_TABLE
0.9s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(*) from INDEXED_TABLE
1.38s PHOENIX-SNAPSHOT

select round(date, 'day',50), sum(core)+2 from INDEXED_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
0.29s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ round(date, 'day',50), sum(core)+2 from INDEXED_TABLE where (CORE<10 or CORE>90) group by round(date, 'day',50), host
1.48s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core IN (1,100)
0.12s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core IN (1,100)
0.08s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core IN (1,100)
0.1s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core IN (1,100)
0.98s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.14s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.15s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
0.12s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core IN (1,25,50,75,100)
1.02s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core < 10 and db < 200
0.2s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE idx1 idx2 idx3 idx4) */ count(core) from INDEXED_TABLE where core < 10 and db < 200
0.66s PHOENIX-SNAPSHOT

select /*+ INDEX(INDEXED_TABLE ids1 ids2 ids3 ids4) */ count(core) from INDEXED_TABLE where core < 10 and db < 200
0.2s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core < 10 and db < 200
1.33s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core < 100 and db < 2000
1.38s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core < 100 and db < 2000
2.83s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core > 90
0.19s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core > 90
1.12s PHOENIX-SNAPSHOT

select count(core) from INDEXED_TABLE where core > 0
0.95s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ count(core) from INDEXED_TABLE where core > 0
1.82s PHOENIX-SNAPSHOT

select db from INDEXED_TABLE where db >5 and db <7 order by db
0.08s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ db from INDEXED_TABLE where db >5 and db <7 order by db
1.84s PHOENIX-SNAPSHOT

select db from INDEXED_TABLE order by db limit 10
0.06s PHOENIX-SNAPSHOT

select /*+NO_INDEX*/ db from INDEXED_TABLE order by db limit 10
2.47s PHOENIX-SNAPSHOT

CREATE INDEX idx5 ON INDEXED_TABLE (CORE) INCLUDE (DB,ACTIVE_VISITOR)
37.89s PHOENIX-SNAPSHOT

LOAD DATA INDEXED_TABLE [2000000 ROWS]
486.5s PHOENIX-SNAPSHOT


TABLE_6CF


Data is split in 6 column families. Phoenix 1.2+ uses Essential Column Family filter feature which fetches only required columns when filtering rows.

ROWS 2000000 [2M]

DDL CREATE TABLE IF NOT EXISTS $TABLE (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CF1.A INTEGER, CF2.B INTEGER, CF3.C INTEGER, CF4.D INTEGER, CF5.E INTEGER, CF6.F INTEGER CONSTRAINT PK PRIMARY KEY (K1,K2)) SPLIT ON ('B','C','D');CREATE TABLE IF NOT EXISTS $TABLE_UPSERTSELECT (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CF1.A INTEGER, CF2.B INTEGER, CF3.C INTEGER, CF4.D INTEGER, CF5.E INTEGER, CF6.F INTEGER CONSTRAINT PK PRIMARY KEY (K1,K2)) SPLIT ON ('B','C','D')

DATA GENERATOR
STRING :: Values: A|B|C|D
STRING :: Length: 10 Values: SEQUENTIAL
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 1000 Values: RANDOM
INTEGER :: Max. Value: 2000 Values: RANDOM
INTEGER :: Max. Value: 5000 Values: RANDOM
INTEGER :: Max. Value: 10000 Values: RANDOM
INTEGER :: Max. Value: 15000 Values: RANDOM

select count(1) from TABLE_6CF where K1 in ('A', 'B', 'C', 'D')
1.55s PHOENIX-SNAPSHOT

select count(1) from TABLE_6CF where K1 in ('A', 'C')
1.34s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF where f < 1000
1.18s PHOENIX-SNAPSHOT

select a,b,c,d,e,f from TABLE_6CF where B>1000 and B<2000 and f>1000 and f<2000
1.31s PHOENIX-SNAPSHOT

select sum(a),sum(b),sum(c),sum(d) from TABLE_6CF group by K1
4.54s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF group by A
1.69s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF group by B
2.55s PHOENIX-SNAPSHOT

select count(*) from TABLE_6CF where f < 10000
2.15s PHOENIX-SNAPSHOT

LOAD DATA TABLE_6CF [2000000 ROWS]
113.01s PHOENIX-SNAPSHOT


SALTED_TABLE


This is Phoenix 1.2+ feature. Data is split in 4 regions equal to number of region servers in test cluster by adding salted byte to each key.

ROWS 2000000 [2M]

DDL CREATE TABLE $TABLE (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CFA.A VARCHAR, CFA.B CHAR(100), CFA.C INTEGER, CFB.D INTEGER CONSTRAINT PK PRIMARY KEY (K1,K2)) SALT_BUCKETS=4

DATA GENERATOR
STRING :: Values: A|B|C|D
STRING :: Length: 10 Values: SEQUENTIAL
STRING :: Length: 100 Values: RANDOM
STRING :: Length: 100 Values: RANDOM
INTEGER :: Max. Value: 1000000 Values: RANDOM
INTEGER :: Max. Value: 1000000 Values: RANDOM

select count(1) from SALTED_TABLE where K1 in ('A', 'B', 'C', 'D')
1.59s PHOENIX-SNAPSHOT

select count(*) from SALTED_TABLE where D < 1000
0.88s PHOENIX-SNAPSHOT

select avg(c),avg(d) from SALTED_TABLE group by K1
3.32s PHOENIX-SNAPSHOT

LOAD DATA SALTED_TABLE [2000000 ROWS]
109.65s PHOENIX-SNAPSHOT


TABLE_1CF


Same data as in 6 column family table but this one only has a single column family. Performance should be worse in most cases.

ROWS 2000000 [2M]

DDL CREATE TABLE IF NOT EXISTS $TABLE (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CF.A INTEGER, CF.B INTEGER, CF.C INTEGER, CF.D INTEGER, CF.E INTEGER, CF.F INTEGER CONSTRAINT PK PRIMARY KEY (K1,K2)) SPLIT ON ('B','C','D');CREATE TABLE IF NOT EXISTS $TABLE_UPSERTSELECT (K1 CHAR(1) NOT NULL, K2 VARCHAR NOT NULL, CF.A INTEGER, CF.B INTEGER, CF.C INTEGER, CF.D INTEGER, CF.E INTEGER, CF.F INTEGER CONSTRAINT PK PRIMARY KEY (K1,K2)) SPLIT ON ('B','C','D')

DATA GENERATOR
STRING :: Values: A|B|C|D
STRING :: Length: 10 Values: SEQUENTIAL
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 1000 Values: RANDOM
INTEGER :: Max. Value: 2000 Values: RANDOM
INTEGER :: Max. Value: 5000 Values: RANDOM
INTEGER :: Max. Value: 10000 Values: RANDOM
INTEGER :: Max. Value: 15000 Values: RANDOM

select count(1) from TABLE_1CF where K1 in ('A', 'B', 'C', 'D')
1.68s PHOENIX-SNAPSHOT

select count(1) from TABLE_1CF where K1 in ('A', 'C')
1.49s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF where f < 1000
1.86s PHOENIX-SNAPSHOT

select a,b,c,d,e,f from TABLE_1CF where B>1000 and B<2000 and f>1000 and f<2000
2.31s PHOENIX-SNAPSHOT

select sum(a),sum(b),sum(c),sum(d) from TABLE_1CF group by K1
3.8s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF group by A
1.99s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF group by B
2.48s PHOENIX-SNAPSHOT

select count(*) from TABLE_1CF where f < 10000
2.22s PHOENIX-SNAPSHOT

LOAD DATA TABLE_1CF [2000000 ROWS]
104.14s PHOENIX-SNAPSHOT


WIDE_PK




ROWS 2000000 [2M]

DDL CREATE TABLE IF NOT EXISTS $TABLE (mypk CHAR(500) NOT NULL PRIMARY KEY,CF.column1 INTEGER,CF.column2 INTEGER,CF.column3 INTEGER,CF.column4 INTEGER,CF.column5 INTEGER) SALT_BUCKETS=4;

DATA GENERATOR
STRING :: Length: 500 Values: SEQUENTIAL
INTEGER :: Values: SEQUENTIAL
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 100 Values: RANDOM
INTEGER :: Max. Value: 100 Values: RANDOM

select count(*) from WIDE_PK
2.26s PHOENIX-SNAPSHOT

select count(*) from WIDE_PK where column2<10
3.51s PHOENIX-SNAPSHOT

select count(*) from WIDE_PK where column2<50 and column3<50 and column4<50 and column5<50
5s PHOENIX-SNAPSHOT

LOAD DATA WIDE_PK [2000000 ROWS]
237.14s PHOENIX-SNAPSHOT



Note: Hover over version label to see Phoenix Query Explain Plan.