mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
24 lines
546 B
MySQL
24 lines
546 B
MySQL
|
DROP TABLE IF EXISTS t_in_tuple_index;
|
||
|
|
||
|
CREATE TABLE t_in_tuple_index
|
||
|
(
|
||
|
`ID` String,
|
||
|
`USER_ID` String,
|
||
|
`PLATFORM` LowCardinality(String)
|
||
|
)
|
||
|
ENGINE = MergeTree()
|
||
|
ORDER BY (PLATFORM, USER_ID, ID)
|
||
|
SETTINGS index_granularity = 2048;
|
||
|
|
||
|
INSERT INTO t_in_tuple_index VALUES ('1', 33, 'insta'), ('2', 33, 'insta');
|
||
|
|
||
|
SELECT count()
|
||
|
FROM t_in_tuple_index
|
||
|
WHERE (PLATFORM, USER_ID) IN (('insta', '33'));
|
||
|
|
||
|
SELECT count()
|
||
|
FROM t_in_tuple_index
|
||
|
WHERE (PLATFORM, USER_ID) IN (('insta', '33'), ('insta', '22'));
|
||
|
|
||
|
DROP TABLE IF EXISTS t_in_tuple_index;
|