Prashant Pandey
07/19/2021, 7:48 AMSelect backend_id, backend_protocol, backend_name, COUNT(*) FROM backendEntityView WHERE tenant_id = '__default' AND ( backend_id IS NOT NULL AND start_time_millis >= 1626546008022 AND start_time_millis < 1626632408022 ) GROUP BY backend_id, backend_protocol, backend_name ORDER BY PERCENTILETDIGEST99(duration_millis) desc limit 10000
We have a sorted index on backend_id
and a range index on start_time_millis
. What we have observed is that PERCENTILETDIGEST99
increases the query time by a large amount (more than 300% easily). Is there some way we can optimise this using pre-aggregations (or some other way)?