I would like to store the data of percentile 99 in every 5 minutes on ClickHouse. But, in case that I want to calculate the p99 for 10 minutes. the average p99 of 2 interval may be not accurate.
I understand that there are method 'T-digest' function that we can merge the t-digest for each interval to estimate the whole percentile. but, I still confuse how can I store the result of T-digest in ClickHouse. Or there are other suitable way to do.
Can anyone suggest me for this scenario. Appreciated for all response.
Thank you is much.
Best Regards,
https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/quantiletdigest/
Computes an approximate quantile of a numeric data sequence using the t-digest algorithm.
quantilesTDigestState uses significantly less data than quantiles in many cases and approximation error is less 1% ( your mileage may vary ).
example with quantiles_tdigest AggregateFunction(quantilesTDigest(0.75, 0.9, 0.95, 0.99), UInt32) CODEC (ZSTD(1))