From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Kathy Zhu <Kathy(dot)Zhu(at)Sun(dot)COM> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: group by |
Date: | 2003-10-03 23:11:35 |
Message-ID: | Pine.LNX.4.33.0310031909050.15689-100000@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, 3 Oct 2003, Kathy Zhu wrote:
> 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
>
I believe Solaris's qsort implementation (which is used for the group by)
has problems dealing with large numbers of similar values.
I think in later versions of pg our own qsort is used.
Kris Jurka
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2003-10-03 23:23:35 | Re: book on advanced postgresql? |
Previous Message | Dennis Gearon | 2003-10-03 22:53:02 | Re: group by |