group by

From: Kathy Zhu <Kathy(dot)Zhu(at)Sun(dot)COM>
To: pgsql-general(at)postgresql(dot)org
Subject: group by
Date: 2003-10-03 22:30:14
Message-ID: 200310032230.h93MUHc29961@amon.Central.Sun.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I notices a weird thing here.

version 7.2.1
on Solaris

table "test", has a field "state".
There are 4 "state" values, 1, 2, 3, 4.

select count(*) from test group by state;
took 11500 msec

but

select count(*) from test where state = 1;
select count(*) from test where state = 2;
select count(*) from test where state = 3;
select count(*) from test where state = 4;
total took 626 msec

Why ??

thanks,
kathy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-10-03 22:52:31 Re: group by
Previous Message scott.marlowe 2003-10-03 22:10:44 Re: pg_restore takes ages