Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.11.0
-
None
-
None
Description
CREATE TABLE IF NOT EXISTS user_events (
user_id VARCHAR NOT NULL,
event_type VARCHAR NOT NULL,
event_time VARCHAR NOT NULL
event_msg VARCHAR NOT NULL
event_status VARCHAR NOT NULL
event_opt VARCHAR NOT NULL
CONSTRAINT my_pk PRIMARY KEY (user_id,event_type,event_time)) SALT_BUCKETS=128;
and my query is:
1.select event_type,count(0) from us_population where user_id='xxxx' group by event_type
2.select count(0) from us_population where user_id='xxxx' and event_type='0101'
3.select * from us_population where user_id='xxxx' and event_type='0101' and event_time>'20180101' and event_time<'20180201' order by event_time limit 50,100
Concurrency query ratio:
1:80%
2:10%
3:10%
user_events data :50billion
It can be a field/some fileds of the primary key salted by hash
grammar with "SALT_BUCKETS(user_id)=4" or "SALT_BUCKETS(user_id,event_type)=4"