ClickHouse/tests/queries/0_stateless/02864_statistics_bug_69589.sql
2024-09-24 09:27:25 +00:00

14 lines
427 B
SQL

-- Tags: no-fasttest
-- no-fasttest: 'countmin' sketches need a 3rd party library
SET allow_experimental_statistics = 1;
SET allow_statistics_optimize = 1;
CREATE TABLE tab (c Nullable(Int)) ENGINE = MergeTree() ORDER BY tuple();
INSERT INTO tab (c) VALUES (1);
DELETE FROM tab WHERE TRUE;
INSERT INTO tab (c) VALUES (2);
ALTER TABLE tab ADD STATISTICS c TYPE countmin;
OPTIMIZE TABLE tab;
SELECT 1 FROM tab WHERE tab.c = 0;