tdigest | PostgreSQL extension for estimating percentiles
kandi X-RAY | tdigest Summary
kandi X-RAY | tdigest Summary
PostgreSQL extension for estimating percentiles using t-digest
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tdigest
tdigest Key Features
tdigest Examples and Code Snippets
-- table with some random source data
CREATE TABLE t (a int, b int, c double precision);
INSERT INTO t SELECT 10 * random(), 10 * random(), random()
FROM generate_series(1,10000000);
-- table with pre-aggregated digests into table "
DO LANGUAGE plpgsql $$
DECLARE
r record;
BEGIN
FOR r IN (SELECT random() AS v FROM generate_series(1,1000)) LOOP
UPDATE t SET d = tdigest_add(d, r.v);
END LOOP;
END $$;
DO LANGUAGE plpgsql $$
DECLARE
a double precision[];
BEGIN
SELECT
SELECT tdigest_json(d) FROM (
SELECT tdigest(t.c, 100) AS d FROM t
) foo;
SELECT CAST(d AS json) FROM (
SELECT tdigest(t.c, 100) AS d FROM t
) foo;
Community Discussions
Trending Discussions on tdigest
QUESTION
I'm trying to order sub aggregation of percentile by order
field (when I run it on avg/sum aggregation it works)
ANSWER
Answered 2021-Jan-05 at 09:32The documentation contains guides on how to sort by multi-value aggregation https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-order
Ordering the buckets by multi value metrics sub-aggregation (identified by the aggregation name):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tdigest
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page