Re: Query take a long time and use no index - Mailing list pgsql-general

From Tomas Vondra
Subject Re: Query take a long time and use no index
Date
Msg-id 7599651d-7269-ec5b-b968-46795a76c375@enterprisedb.com
Whole thread Raw
In response to Re: Query take a long time and use no index  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: Query take a long time and use no index
List pgsql-general
On 7/17/23 13:20, Tomas Vondra wrote:
> ...
> 
> It's always going to be slow with the COUNT(DISTINCT), I'm afraid.
> 
> Not sure how much you can modify the query / database, and how accurate
> results you need. If you're OK with estimates, you can try postgres-hll
> extension [2] which estimates count(distinct). For exact reaults, I
> wrote count_distinct extension [2] that uses hashtable. Might be worth a
> try, I guess.
> 

Damn, I forgot to add the links:

[1] https://github.com/citusdata/postgresql-hll

[2] https://github.com/tvondra/count_distinct

regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Query take a long time and use no index
Next
From: Ron
Date:
Subject: Re: Query take a long time and use no index