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

Don't visit the AST for UDFs if none are registered #40069

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

Algunenano
Copy link
Member

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Don't visit the AST for UDFs if none are registered

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

More work to reduce query interpretation (#39996)

In this case perf is showing that ~1% of the query (in the query for #40065) is spent on the UserDefinedSQLFunctionMatcher visitor:

-    1.05%     0.23%           755  TCPHandler      libclickhouse_interpreters.so                        [.] DB::UserDefinedSQLFunctionMatcher::visit                                                                                                       ▒
   - 0.82% DB::UserDefinedSQLFunctionMatcher::visit                                                                                                                                                                                                         ▒
      - 0.79% DB::UserDefinedSQLFunctionMatcher::tryToReplaceFunction                                                                                                                                                                                       ▒
           0.69% DB::UserDefinedSQLFunctionFactory::tryGet

It doesn't make sense to pay for this visitor if you are not using UDFs.

@robot-clickhouse robot-clickhouse added the pr-performance Pull request with some performance improvements label Aug 10, 2022
@kitaisreal kitaisreal self-assigned this Aug 10, 2022
@kitaisreal
Copy link
Collaborator

@Algunenano why we make it as draft, it seems that change is small and well isolated we can merge it.

@Algunenano
Copy link
Member Author

Sorry, but once you create a draft MR the default changes and any new PR is open as draft if you don't change it back.

@Algunenano Algunenano marked this pull request as ready for review August 11, 2022 12:09
@kitaisreal kitaisreal merged commit 45d6995 into ClickHouse:master Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-performance Pull request with some performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants