We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CREATE TABLE t (id Int16, val Int32, dt Date) ENGINE=MergeTree Order by dt;
ALTER TABLE t ADD PROJECTION prj_group ( SELECT sum(val) GROUP BY dt );
insert into t values (1,10,'2024-05-01'),(2,20,'2024-05-01'),(3,30,'2024-05-01'),(4,40,'2024-05-01'),(5,50,'2024-05-01');
explain indexes = 1 select sum(val) from t;
create view v as select * from t;
explain indexes = 1 select sum(val) from v group by dt;
https://fiddle.clickhouse.com/720713cd-39b6-402d-a51a-60f3183e965a
The text was updated successfully, but these errors were encountered:
Duplicate #32753
Sorry, something went wrong.
No branches or pull requests
CREATE TABLE t (id Int16, val Int32, dt Date) ENGINE=MergeTree Order by dt;
ALTER TABLE t
ADD PROJECTION prj_group
(
SELECT sum(val)
GROUP BY dt
);
insert into t values (1,10,'2024-05-01'),(2,20,'2024-05-01'),(3,30,'2024-05-01'),(4,40,'2024-05-01'),(5,50,'2024-05-01');
explain indexes = 1 select sum(val) from t;
create view v as select * from t;
explain indexes = 1 select sum(val) from v group by dt;
https://fiddle.clickhouse.com/720713cd-39b6-402d-a51a-60f3183e965a
The text was updated successfully, but these errors were encountered: