Re: count(*) of zero rows returns 1

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Johnston <polobo(at)yahoo(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: count(*) of zero rows returns 1
Date: 2013-01-21 17:37:50
Message-ID: CABRT9RBRxmQ0KUxYWFnpK+nSMa0frrP9Jrh9ERv3NCxzF9ag4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 15, 2013 at 5:47 AM, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com> wrote:
> postgres=# select * from test_0_col_table ;
> --
> (200000 rows)

Interestingly, PostgreSQL 9.2 has regressed here. Not sure if we care,
but worth mentioning:

psql (9.2.2)

test=# select count(*) from foo1;
count
----------
10000000
(1 row)
Time: 632.907 ms

test=# select * from foo1;
(No rows)
Time: 1012.567 ms

Regards,
Marti

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-01-21 18:04:14 Re: proposal: fix corner use case of variadic fuctions usage
Previous Message Dimitri Fontaine 2013-01-21 17:27:12 Re: Event Triggers: adding information