Skip to content

Commit

Permalink
don't rewrite comparison queries for clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 committed Dec 12, 2024
1 parent f979e7d commit 533c30f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runtime/metricsview/executor_rewrite_approx_comparisons.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
// Extracts out the base or comparison query into a CTE depending on the sort field.
// This is done to enable more efficient query execution by adding filter in the join query to select only dimension values present in the CTE.
func (e *Executor) rewriteApproxComparisons(ast *AST) {
// don't optimize for ClickHouse as its unable to inline the CTE results causing multiple scans
if e.olap.Dialect() == drivers.DialectClickHouse {
return
}

if !e.instanceCfg.MetricsApproximateComparisons {
return
}
Expand Down

0 comments on commit 533c30f

Please sign in to comment.