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

Materialized view scalar subqueries #32811

Merged

Conversation

Algunenano
Copy link
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Avoid reusing the scalar subquery cache when processing MV blocks. This fixes a bug when the scalar query reference the source table but it means that all subscalar queries in the MV definition will be calculated for each block.

Detailed description / Documentation draft:

Related to the issue reported in #9587 (comment)

I'm not super happy with the solution. As I mentioned in a comment the ideal situation would be that we only discard scalar results if the source table was involved.

This way we can reuse scalars from other queries (non MVs) and
leave the door open for future improvements
@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Dec 15, 2021
Copy link
Member

@vdimir vdimir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fix is pretty simple and test is present, let's merge. Thank you!

@vdimir vdimir merged commit 2f2d98d into ClickHouse:master Dec 16, 2021
@vdimir vdimir self-assigned this Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants