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

Re: Much Ado About COUNT(*)

From: "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Much Ado About COUNT(*)
Date: 2005-01-12 18:55:29
Message-ID: 41E572A1.8050209@tvi.edu (view raw or flat)
Thread:
Lists: pgsql-announcepgsql-hackerspgsql-patches
Tom,

Thank you for your prompt response and I understand your statement 
completely.

My thinking is that we may be able to implement index usage for not only 
unqualified counts, but also on any query that can be satisfied by the 
index itself. Index usage seems to be a feature that could speed up 
PostgreSQL for many people. I'm working on a project right now that 
could actually take advantage of it.

Looking at the message boards, there is significant interest in the 
COUNT(*) aspect. However, rather than solely address the COUNT(*) TODO 
item, why not fix it and add additional functionality found in 
commercial databases as well? I believe Oracle has had this feature 
since 7.3 and I know people take advantage of it.

I understand that you guys have a lot more important stuff to do than 
work on something like this. Unlike other people posting the request and 
whining about the speed, I'm offering to take it on and fix it.

Take this mesage as my willingness to propose and implement this 
feature. Any details, pitfalls, or suggestions are appreciated.

Thanks again!

-Jonah

Tom Lane wrote:

>"Jonah H. Harris" <jharris(at)tvi(dot)edu> writes:
>  
>
>>Tom, Bruce, and others involved in this recurring TODO discussion…
>>First, let me start by saying that I understand this has been discussed 
>>many times before; however, I’d like to see what the current state of 
>>affairs is regarding the possibility of using a unique index scan to 
>>speed up the COUNT aggregate.
>>    
>>
>
>It's not happening, because no one has come up with a workable proposal.
>In particular, we're not willing to slow down every other operation in
>order to make COUNT-*-with-no-WHERE-clause faster.
>
>			regards, tom lane
>  
>


In response to

Responses

pgsql-announce by date

Next:From: Reinhard MaxDate: 2005-01-12 19:11:32
Subject: Re: [HACKERS] segfault caused by heimdal (was: SUSE port)
Previous:From: Reinhard MaxDate: 2005-01-12 18:36:52
Subject: segfault caused by heimdal (was: SUSE port)

pgsql-hackers by date

Next:From: Reinhard MaxDate: 2005-01-12 19:11:32
Subject: Re: [HACKERS] segfault caused by heimdal (was: SUSE port)
Previous:From: Merlin MoncureDate: 2005-01-12 18:53:51
Subject: Re: Much Ado About COUNT(*)

pgsql-patches by date

Next:From: Reinhard MaxDate: 2005-01-12 19:11:32
Subject: Re: [HACKERS] segfault caused by heimdal (was: SUSE port)
Previous:From: Reinhard MaxDate: 2005-01-12 18:36:52
Subject: segfault caused by heimdal (was: SUSE port)

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