Re: speeding up COUNT and DISTINCT queries

From: Max Baker <max(at)warped(dot)org>
To: Chad Thompson <chad(at)weblinkservices(dot)com>
Cc: PostgreSQL Performance Mailing List <pgsql-performance(at)postgresql(dot)org>
Subject: Re: speeding up COUNT and DISTINCT queries
Date: 2003-03-13 01:00:19
Message-ID: 20030313010018.GN30411@warped.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Mar 12, 2003 at 03:55:09PM -0700, Chad Thompson wrote:
> Ive found that group by works faster than distinct.
>
> Try
> EXPLAIN ANALYZE select mac from node group by mac;

This was about 25% faster, thanks!

That will work for distinct() only calls, but I still am looking for a
way to speed up the count() command. Maybe an internal counter of rows,
and triggers?

-m

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Max Baker 2003-03-13 01:55:40 Re: speeding up COUNT and DISTINCT queries
Previous Message Manfred Koizar 2003-03-12 23:48:27 Re: speeding up COUNT and DISTINCT queries