From: | "Diehl, Jeffrey" <jdiehl(at)sandia(dot)gov> |
---|---|
To: | "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Diehl, Jeffrey" <jdiehl(at)sandia(dot)gov> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Out of free buffers... HELP! |
Date: | 2001-09-20 18:49:10 |
Message-ID: | B51F0C636E578A4E832D3958690CD73E0130C041@es04snlnt |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Well, this was just a suggestion to make my queries run fast. I didn't
quite understand the difference between the two, so I thought I'd ask.
Thanx for clearing that up for me.
Mike Diehl,
Network Monitoring Tool Devl.
Sandia National Laboratories.
(505) 284-3137
jdiehl(at)sandia(dot)gov
> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: September 20, 2001 12:56 AM
> To: Diehl, Jeffrey
> Cc: 'Haller Christoph'; pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] Out of free buffers... HELP!
>
>
> "Diehl, Jeffrey" <jdiehl(at)sandia(dot)gov> writes:
> > Ok, can someone explain to me why this first query might
> run faster than the
> > second?
> > select src,dst,count(dst) from data;
> > select src,dst,count(*) from data;
>
> Hmm, I'd expect the second to be marginally faster. count(*)
> counts the
> number of rows matching the WHERE condition; count(foo) counts the
> number of rows matching the WHERE condition for which foo is not NULL.
> So count(foo) ought to involve a couple extra cycles to test for
> non-NULL-ness of the specified field. But it's hard to believe you
> could measure the difference --- what results are you getting?
>
> regards, tom lane
>
From | Date | Subject | |
---|---|---|---|
Next Message | Diehl, Jeffrey | 2001-09-20 19:06:27 | Re: Out of free buffers... HELP! |
Previous Message | Thurstan R. McDougle | 2001-09-20 16:30:46 | Re: Selecting latest value II |