-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimeplus_generate_data.sql
117 lines (113 loc) · 8.71 KB
/
timeplus_generate_data.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
CREATE RANDOM STREAM r_products
(
`id` string DEFAULT 'key_' || to_string(rand64() % 300000000),
`name` string,
`d1` string,
`d2` string,
`d3` string,
`d4` string,
`d5` string,
`d6` string,
`d7` string,
`d8` string,
`d9` string,
`d10` string,
`d11` string,
`d12` string,
`d13` string,
`d14` string,
`d15` string,
`d16` string,
`d17` string,
`d18` string,
`d19` string,
`d20` string,
`d21` string,
`d22` string,
`d23` string,
`d24` string,
`d25` string,
`d26` string,
`d27` string,
`d28` string,
`d29` string,
`d30` string,
`d31` string,
`d32` string,
`d33` string,
`d34` string,
`d35` string,
`d36` string,
`d37` string,
`d39` string,
`d40` string,
`d41` string,
`d42` string,
`d43` string,
`d44` string,
`d45` string,
`d46` string,
`d47` string,
`d48` string,
`d49` string,
`d50` string,
`dt` datetime64(3)
) SETTINGS shards=8;
create mutable stream products
(
`id` string,
`name` string,
`d1` string,
`d2` string,
`d3` string,
`d4` string,
`d5` string,
`d6` string,
`d7` string,
`d8` string,
`d9` string,
`d10` string,
`d11` string,
`d12` string,
`d13` string,
`d14` string,
`d15` string,
`d16` string,
`d17` string,
`d18` string,
`d19` string,
`d20` string,
`d21` string,
`d22` string,
`d23` string,
`d24` string,
`d25` string,
`d26` string,
`d27` string,
`d28` string,
`d29` string,
`d30` string,
`d31` string,
`d32` string,
`d33` string,
`d34` string,
`d35` string,
`d36` string,
`d37` string,
`d39` string,
`d40` string,
`d41` string,
`d42` string,
`d43` string,
`d44` string,
`d45` string,
`d46` string,
`d47` string,
`d48` string,
`d49` string,
`d50` string,
`dt` DateTime64(3)
) PRIMARY KEY id
SETTINGS shards = 8;
-- Populate ~200 million products
INSERT INTO products(* EXCEPT(_tp_sn)) SELECT * FROM r_products LIMIT 200000000 SETTINGS eps = 10000000;