Re: count(distinct) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: count(distinct)
Date
Msg-id 498C4AAA.9080304@archonet.com
Whole thread Raw
In response to count(distinct)  (Zdravko Balorda <zdravko.balorda@siix.com>)
List pgsql-sql
Zdravko Balorda wrote:
> this is probably an old issue but I'm not all that experienced.
> 
> I wonder if an index can be accessed rather directly, as to speed up
> a query like "select count(distinct())", by simply calculating the
> number of branches (leaves) an index has. Or at least to skip sorting.

Afraid not. Have a search of the archives for discussion on "mvcc
visibility indexes" for lots on this.

--  Richard Huxton Archonet Ltd


pgsql-sql by date:

Previous
From: Zdravko Balorda
Date:
Subject: count(distinct)
Next
From: Michael B Allen
Date:
Subject: Re: Implementing "access lists" (was: Must I use DISTINCT?)