Re: Speed comparison to Oracle. Why was this query slower

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Francisco Reyes <lists(at)natserv(dot)com>, pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Speed comparison to Oracle. Why was this query slower
Date: 2002-02-23 00:20:56
Message-ID: 200202230020.g1N0KuW09576@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > On Fri, Feb 22, 2002 at 05:23:40PM -0500, Francisco Reyes wrote:
> >>> Is Oracle better at aggregate functions?
> >> How could it be done in a more clever fashion?
>
> > By hashing. Get a hash table. For each row, hash the grouping rows to lookup
> > the intermediate aggregate stage to aggregate this row into. At the end, run
> > through your hash dumping the results.
>
> This is on our TODO list. It'd be interesting to know whether that is
> the source of Oracle's speed advantage in this particular scenario,
> though. What is PG's EXPLAIN output for this query, and what does
> Oracle have to say about it? (They don't call it EXPLAIN, but I know
> they have an equivalent function to show the query plan for a query.)

Was the original users doing GROUP BY with the aggregate? I don't
remember.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-02-23 01:58:13 Re: Casting Varchar to Numeric
Previous Message Tom Lane 2002-02-23 00:16:49 Re: restore problem from pg_dump & serial