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

Re: [BUGS] SELECT "bug"?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUGS] SELECT "bug"?
Date: 2000-01-21 22:16:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The Hermit Hacker <scrappy(at)hub(dot)org> writes:
> select count(1) from webhit_details_formatted where counter_id = 1;
> [ hangs, then crashes when try to cancel ]

Wow, how'd that escape notice for this long?

play=> create table webhit_details_formatted (counter_id int);
play=>  select count(1) from webhit_details_formatted where counter_id = 1;
pqReadData() -- backend closed the channel unexpectedly.

Mine just crashes immediately, no waiting.

The good news is that current sources don't seem to have the problem.

> Under Oracle, doing the "SELECT count(1)..." is faster then doing "SELECT
> count(*)..." (supposedly), since it doesn't have to retrieve all the
> information, only count how many records match the WHERE clause ...

Under Postgres, there's no difference --- in fact, the parser currently
converts count(*) into count(1) ;-)

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-01-21 22:25:39
Subject: Re: [BUGS] SELECT "bug"?
Previous:From: The Hermit HackerDate: 2000-01-21 19:16:24
Subject: SELECT "bug"?

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