Re: Question on COUNT performance - Mailing list pgsql-sql

From Reinoud van Leeuwen
Subject Re: Question on COUNT performance
Date
Msg-id 20100714134410.GK62243@spoetnik.xs4all.nl
Whole thread Raw
In response to Re: Question on COUNT performance  (Joshua Tolley <eggyknap@gmail.com>)
List pgsql-sql
On Wed, Jul 14, 2010 at 07:30:39AM -0600, Joshua Tolley wrote:

> > Have you tried 'select count (1)..."?
> 
> If this helps at all, it's unlikely to help much. I remember having seen
> discussion somewhere that there's an optimization such that count(*) and
> count(1) do the same thing anyway, but I can't find it in the code
> immediately. 

oops, I was thinking too much about Sybase (where is makes a huge 
difference, since the optimiser sees that everything it needs can be found 
in the index so the table does not have to be read at all).

Reinoud

-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen    reinoud.v@n.leeuwen.net
http://reinoud.van.leeuwen.net kvk 27320762
__________________________________________________


pgsql-sql by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: Question on COUNT performance
Next
From: Thomas Kellerer
Date:
Subject: Re: subtract two dates to get the number of days