Skip to content
New issue

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

Slow materialized view creation if it contains a heavy query introduced in version 24.1 #59795

Closed
glebinc opened this issue Feb 9, 2024 · 1 comment · Fixed by #60464
Closed

Comments

@glebinc
Copy link

glebinc commented Feb 9, 2024

Describe the unexpected behaviour
Version 24.1 introduced a regression which manifests itself as taking a long time to create materialized view with a heavy query probably because of analyzing this query. Possibly related to #57855

image
image

How to reproduce

create table source(type String) engine=MergeTree order by type;

create view v_heavy as
with nums as (select number from numbers(1e5))
select count(*) n from (select number from numbers(1e5) n1 cross join nums);

create table target1(type String) engine=MergeTree order by type;
create table target2(type String) engine=MergeTree order by type;

create materialized view vm_target1 to target1 as select * from source where type='one';
-- this statement takes a long time in 24.1
create materialized view vm_target2 to target2 as select * from source where type='two' and (select n from v_heavy)>0;

Expected behavior
Creation of a materialized view should not take the same time as the query it contains.

@antonio2368
Copy link
Member

antonio2368 commented Feb 9, 2024

Confirmed it's related to #57855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants