2019-06-03 17:36:27 +00:00
|
|
|
DROP TABLE IF EXISTS test_00563;
|
2018-01-29 01:39:41 +00:00
|
|
|
|
2019-06-03 17:36:27 +00:00
|
|
|
CREATE TABLE test_00563 ( dt Date, site_id Int32, site_key String ) ENGINE = MergeTree(dt, (site_id, site_key, dt), 8192);
|
|
|
|
INSERT INTO test_00563 (dt,site_id, site_key) VALUES ('2018-1-29', 100, 'key');
|
|
|
|
SELECT * FROM test_00563 WHERE toInt32(site_id) IN (100);
|
|
|
|
SELECT * FROM test_00563 WHERE toInt32(site_id) IN (100,101);
|
2018-01-29 01:39:41 +00:00
|
|
|
|
2019-06-03 17:36:27 +00:00
|
|
|
DROP TABLE IF EXISTS test_00563;
|
2018-02-14 17:39:16 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS join_with_index;
|
|
|
|
CREATE TABLE join_with_index (key UInt32, data UInt64) ENGINE = MergeTree ORDER BY key SETTINGS index_granularity=1;
|
|
|
|
INSERT INTO join_with_index VALUES (1, 0), (2, 99);
|
2018-02-14 17:39:16 +00:00
|
|
|
|
|
|
|
SELECT key + 1
|
2019-04-16 14:13:13 +00:00
|
|
|
FROM join_with_index
|
2018-02-14 17:39:16 +00:00
|
|
|
ALL INNER JOIN
|
|
|
|
(
|
|
|
|
SELECT
|
|
|
|
key,
|
|
|
|
data
|
2019-04-16 14:13:13 +00:00
|
|
|
FROM join_with_index
|
2018-02-14 17:39:16 +00:00
|
|
|
WHERE toUInt64(data) IN (0, 529335254087962442)
|
2019-08-29 18:45:34 +00:00
|
|
|
) js2 USING (key);
|
2018-03-16 14:01:00 +00:00
|
|
|
|
|
|
|
SELECT _uniq, _uniq IN (0, 99)
|
2019-04-16 14:13:13 +00:00
|
|
|
FROM join_with_index
|
2018-03-16 14:01:00 +00:00
|
|
|
ARRAY JOIN
|
|
|
|
[key, data] AS _uniq
|
|
|
|
ORDER BY _uniq;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS join_with_index;
|