Skip to content

It seems that new analyzer can be quite slower than old analyzer for complex queries #86019

@andrea-s

Description

@andrea-s

Company or project name

No response

Describe the situation

Statwolf

Which ClickHouse versions are affected?

As per title, I am seeing some big slowdowns when enabling the new analyzer on queries which are large (not in terms of data but rather in query complexity).

This is visible without running the queries, just explain select ... with allow_experimental_analyzer=1/0 presents the slowdown.

I'm looking now for instance to an example where it takes 102s to the new analyzer to explain a certain query and 7s to the old one.

Is this known/expected and if so, is there plan to work on the performance of the new optimizer in the future? Or otherwise, is there something I could do to pinpoint why it takes so much longer? Logging with trace is not helpful as no traces are emitted until the actual query execution starts.

I should also note that explain AST shows the same performance between the old and new analyzer, things seem to get mushy only when doing explain and query execution.

I'm on 25.4.5.24 at the moment.

Thank you very much

How to reproduce

explain settings allow_experimental_analyzer=0/1.

Expected performance

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

analyzerIssues and pull-requests related to new analyzerperformance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions