| From: | "Mitch Vincent" <mitch(at)venux(dot)net> | 
|---|---|
| To: | <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: Sort | 
| Date: | 2000-07-21 19:03:18 | 
| Message-ID: | 00be01bff346$54e09d50$4100000a@doot | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
----- Original Message -----
From: "Nathan Barnett" <nbarnett(at)cellularphones(dot)com>
To: "'Mitch Vincent'" <mitch(at)venux(dot)net>
Sent: Friday, July 21, 2000 3:03 PM
Subject: RE: [GENERAL] Sort
> Here is the query:
>
> SELECT Impression.AdNumber_AdNum,
>     Impression.Webmaster_WebmasterNum,
>     Impression.Banner_BannerNum, COUNT(Click.ClickNum)
>     AS ClickCount
> FROM Impression INNER JOIN
>     Click ON
>     Impression.ImpressionNum = Click.Impression_ImpressionNum
> GROUP BY Impression.AdNumber_AdNum,
>     Impression.Webmaster_WebmasterNum,
>     Impression.Banner_BannerNum
>
> -----------------
> Nathan Barnett
>
> -----Original Message-----
> From: pgsql-general-owner(at)hub(dot)org [mailto:pgsql-general-owner(at)hub(dot)org]On
> Behalf Of Mitch Vincent
> Sent: Friday, July 21, 2000 2:48 PM
> To: Nathan Barnett; pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Sort
>
>
> Show the query and maybe someone could help :-)
>
> ----- Original Message -----
> From: "Nathan Barnett" <nbarnett(at)cellularphones(dot)com>
> To: <pgsql-general(at)postgresql(dot)org>
> Sent: Friday, July 21, 2000 2:33 PM
> Subject: [GENERAL] Sort
>
>
> > I'm currently using v7.0.2 of PostgreSQL.
> >
> > I have a query that performs a group by on three columns.  The EXPLAIN
of
> > the query is as follows:
> >
> > Aggregate  (cost=4116.05..4125.47 rows=94 width=24)
> >   ->  Group  (cost=4116.05..4123.12 rows=942 width=24)
> >         ->  Sort  (cost=4116.05..4116.05 rows=942 width=24)
> >               ->  Nested Loop  (cost=0.00..4069.52 rows=942 width=24)
> >                     ->  Seq Scan on click  (cost=0.00..15.42 rows=942
> > width=8)
> >                     ->  Index Scan using impression_pkey on impression
> > (cost=0.00..4.29 rows=1 width=16)
> >
> > I need to speed up this query.  I have already created an index on the
> three
> > columns query_idx(columna, columnb,columnc).  Is there some other index
> that
> > I could add which would speed up the query.  There is a high frequency
in
> > the table of each group.  Each group probably makes up 10% of the table.
> > Does this force a sequence scan when sorting and grouping?  Basically
just
> > looking for suggestions.
> >
> >
> > ----------------
> > Nathan Barnett
> >
> >
>
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nathan Barnett | 2000-07-21 19:07:12 | RE: Sort | 
| Previous Message | Mitch Vincent | 2000-07-21 18:48:26 | Re: Sort |