Re: Out of free buffers... HELP!
От | Diehl, Jeffrey |
---|---|
Тема | Re: Out of free buffers... HELP! |
Дата | |
Msg-id | B51F0C636E578A4E832D3958690CD73E0130C041@es04snlnt обсуждение исходный текст |
Ответ на | Out of free buffers... HELP! ("Diehl, Jeffrey" <jdiehl@sandia.gov>) |
Список | 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@sandia.gov > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: September 20, 2001 12:56 AM > To: Diehl, Jeffrey > Cc: 'Haller Christoph'; pgsql-sql@postgresql.org > Subject: Re: [SQL] Out of free buffers... HELP! > > > "Diehl, Jeffrey" <jdiehl@sandia.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 >
В списке pgsql-sql по дате отправления: