mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
upd setSkipIndexes
This commit is contained in:
parent
08d23c16d1
commit
579832ff9b
@ -353,6 +353,11 @@ void MergeTreeData::setSkipIndexes(const ASTPtr & indexes_asts, bool only_check)
|
||||
{
|
||||
if (!indexes_asts)
|
||||
{
|
||||
if (!only_check)
|
||||
{
|
||||
skip_indexes_ast = indexes_asts;
|
||||
indexes.clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192
|
||||
CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
1 2
|
||||
CREATE TABLE test.minmax_idx2 ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192
|
||||
1 2
|
||||
1 2
|
@ -16,7 +16,7 @@ ALTER TABLE test.minmax_idx ADD INDEX idx3 BY u64 - i32 TYPE minmax GRANULARITY
|
||||
|
||||
SHOW CREATE TABLE test.minmax_idx;
|
||||
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 2;
|
||||
|
||||
INSERT INTO test.minmax_idx VALUES (1, 2);
|
||||
INSERT INTO test.minmax_idx VALUES (1, 2);
|
||||
@ -24,16 +24,16 @@ INSERT INTO test.minmax_idx VALUES (1, 2);
|
||||
INSERT INTO test.minmax_idx VALUES (1, 2);
|
||||
INSERT INTO test.minmax_idx VALUES (1, 2);
|
||||
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 2;
|
||||
|
||||
ALTER TABLE test.minmax_idx DROP INDEX idx1;
|
||||
|
||||
SHOW CREATE TABLE test.minmax_idx;
|
||||
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 2;
|
||||
|
||||
ALTER TABLE test.minmax_idx DROP INDEX idx3;
|
||||
ALTER TABLE test.minmax_idx DROP INDEX idx2;
|
||||
ALTER TABLE test.minmax_idx DROP INDEX idx3;
|
||||
|
||||
SHOW CREATE TABLE test.minmax_idx;
|
||||
|
||||
@ -41,7 +41,7 @@ ALTER TABLE test.minmax_idx ADD INDEX idx1 BY u64 * i32 TYPE minmax GRANULARITY
|
||||
|
||||
SHOW CREATE TABLE test.minmax_idx;
|
||||
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx WHERE u64 * i32 = 2;
|
||||
|
||||
|
||||
CREATE TABLE test.minmax_idx2
|
||||
@ -56,13 +56,13 @@ INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10,
|
||||
INSERT INTO test.minmax_idx2 VALUES (1, 2);
|
||||
INSERT INTO test.minmax_idx2 VALUES (1, 2);
|
||||
|
||||
SELECT * FROM test.minmax_idx2 WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx2 WHERE u64 * i32 = 2;
|
||||
|
||||
ALTER TABLE test.minmax_idx2 DROP INDEX idx1, DROP INDEX idx2;
|
||||
|
||||
SHOW CREATE TABLE test.minmax_idx2;
|
||||
|
||||
SELECT * FROM test.minmax_idx2 WHERE u64 * i32 = 3;
|
||||
SELECT * FROM test.minmax_idx2 WHERE u64 * i32 = 2;
|
||||
|
||||
DROP TABLE test.minmax_idx;
|
||||
DROP TABLE test.minmax_idx2;
|
Loading…
Reference in New Issue
Block a user