mirror of
https://github.com/statbate/docs.git
synced 2026-08-11 02:42:41 +00:00
update
This commit is contained in:
commit
eabb01cfef
21 changed files with 921 additions and 0 deletions
32
install/sql/clickhouse.sql
Normal file
32
install/sql/clickhouse.sql
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
CREATE DATABASE statbate;
|
||||
USE statbate;
|
||||
|
||||
CREATE TABLE room
|
||||
(
|
||||
id Int32,
|
||||
gender UInt8
|
||||
) ENGINE = MySQL('127.0.0.1:3306', 'base', 'room', 'user', 'passwd');
|
||||
|
||||
|
||||
CREATE TABLE stat
|
||||
(
|
||||
did UInt32,
|
||||
rid UInt32,
|
||||
token UInt32,
|
||||
time Date,
|
||||
INDEX a did TYPE bloom_filter() GRANULARITY 1,
|
||||
INDEX b rid TYPE bloom_filter() GRANULARITY 1
|
||||
)
|
||||
ENGINE = MergeTree()
|
||||
PARTITION BY toYYYYMMDD(time)
|
||||
ORDER BY (time, rid, did)
|
||||
PRIMARY KEY (time)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
#CREATE TABLE stat_buffer (
|
||||
# did UInt32,
|
||||
# rid UInt32,
|
||||
# token UInt32,
|
||||
# time Date
|
||||
#)
|
||||
#ENGINE = Buffer('statbate', 'stat', 16, 5, 30, 1000, 10000, 1000000, 10000000);
|
||||
Loading…
Add table
Add a link
Reference in a new issue