-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Fuse some aggregate functions, part 2. #25961
Copy link
Copy link
Closed
Labels
Description
Continuation of #20091
If query has multiple quantile aggregate functions with the same arguments but different level parameter:
SELECT quantile(0.5)(x), quantile(0.9)(x), quantile(0.95)(x) FROM ...
Rewrite it to
SELECT quantiles(0.5, 0.9, 0.95)(x)[1], quantiles(0.5, 0.9, 0.95)(x)[2], quantiles(0.5, 0.9, 0.95)(x)[3] FROM ...
So the aggregation will share the state.
This should be applied to every type of quantile calculation algorithm (quantile, quantileDeterministic, quantileTiming, quantileTDigest, quantileTDigestWeighted, quantileExact, quantileExactWeighted, quantileBFloat16).
Reactions are currently unavailable