Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group