mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-13 11:04:10 +00:00
131 lines
1.1 KiB
Plaintext
131 lines
1.1 KiB
Plaintext
simple partition key:
|
|
-61
|
|
-60
|
|
-59
|
|
-58
|
|
-57
|
|
-5
|
|
-4
|
|
-3
|
|
-2
|
|
-1
|
|
0
|
|
0
|
|
1
|
|
2
|
|
3
|
|
4
|
|
57
|
|
58
|
|
59
|
|
60
|
|
where id % 200 = +-2:
|
|
-202
|
|
202
|
|
where id % 200 > 0:
|
|
195
|
|
196
|
|
197
|
|
198
|
|
199
|
|
201
|
|
202
|
|
203
|
|
204
|
|
where id % 200 < 0:
|
|
-205
|
|
-204
|
|
-203
|
|
-202
|
|
-201
|
|
-199
|
|
-198
|
|
-197
|
|
-196
|
|
tuple as partition key:
|
|
(-1,-1)
|
|
(-1,0)
|
|
(-2,-2)
|
|
(-2,-3)
|
|
(-2,59)
|
|
(-2,60)
|
|
(0,-4)
|
|
(0,-5)
|
|
(0,-57)
|
|
(0,-58)
|
|
(0,4)
|
|
(0,57)
|
|
(0,58)
|
|
(1,-61)
|
|
(1,0)
|
|
(1,1)
|
|
(2,-59)
|
|
(2,-60)
|
|
(2,2)
|
|
(2,3)
|
|
recursive modulo partition key:
|
|
(-1,-1,0)
|
|
(-2,-2,-1)
|
|
(-3,-3,-2)
|
|
(-4,-4,-2)
|
|
(-5,-5,-2)
|
|
(-57,-7,-28)
|
|
(-58,-8,-29)
|
|
(-59,-9,-30)
|
|
(-60,0,-30)
|
|
(-61,-1,-30)
|
|
(0,0,0)
|
|
(0,0,0)
|
|
(1,1,0)
|
|
(2,2,1)
|
|
(3,3,2)
|
|
(4,4,2)
|
|
(57,7,28)
|
|
(58,8,29)
|
|
(59,9,30)
|
|
(60,0,30)
|
|
After detach:
|
|
(-1,-1,0)
|
|
(-2,-2,-1)
|
|
(-3,-3,-2)
|
|
(-4,-4,-2)
|
|
(-5,-5,-2)
|
|
(-57,-7,-28)
|
|
(-58,-8,-29)
|
|
(-59,-9,-30)
|
|
(-60,0,-30)
|
|
(-61,-1,-30)
|
|
(0,0,0)
|
|
(0,0,0)
|
|
(1,1,0)
|
|
(2,2,1)
|
|
(3,3,2)
|
|
(4,4,2)
|
|
(57,7,28)
|
|
(58,8,29)
|
|
(59,9,30)
|
|
(60,0,30)
|
|
Indexes:
|
|
100
|
|
comparison:
|
|
0 -205 -5 -5
|
|
1 -204 -4 -4
|
|
2 -203 -3 -3
|
|
3 -202 -2 -2
|
|
4 -201 -1 -1
|
|
5 -200 0 0
|
|
6 -199 -199 57
|
|
7 -198 -198 58
|
|
8 -197 -197 59
|
|
9 -196 -196 60
|
|
400 195 195 -61
|
|
401 196 196 -60
|
|
402 197 197 -59
|
|
403 198 198 -58
|
|
404 199 199 -57
|
|
405 200 0 0
|
|
406 201 1 1
|
|
407 202 2 2
|
|
408 203 3 3
|
|
409 204 4 4
|