| From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
|---|---|
| To: | Konstantinos Agouros <elwood(at)agouros(dot)de> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Performance-Tuning |
| Date: | 2001-01-19 17:48:58 |
| Message-ID: | Pine.BSF.4.21.0101190945180.5520-100000@megazone23.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Well, since you're grouping, you don't need the distinct on (it's
sort of assumed by group by - you're only going to get one group
for each distinct value set of your grouped columns). In my
explain, this cuts out a unique step on my small tables, not
sure how significant that's going to be on an already unique
set of columns though.
On Fri, 19 Jan 2001, Konstantinos Agouros wrote:
> Hi,
>
> I have a table with the fields data(timestamp), region and url (varchar)
> This table has 4.5mio entries a day. To reduce them I use the following
> insert-statement.
>
> insert into msreduce select distinct on (region, url) '1-16-2001',region,url,count(client) from microsoftlog where date > '1-16-2001' and date < '1-17-2001' group by region,url
>
> My question: Could this be optimized?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2001-01-19 18:34:50 | Re: RegisterSharedInvalid? |
| Previous Message | Stephan Szabo | 2001-01-19 17:37:02 | Re: child table doesn't inherit PRIMARY KEY? |