Re: is it possible to make this faster? - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: is it possible to make this faster?
Date
Msg-id 20060525204746.GA26341@wolff.to
Whole thread Raw
In response to Re: is it possible to make this faster?  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-performance
On Thu, May 25, 2006 at 16:31:40 -0400,
  Merlin Moncure <mmoncure@gmail.com> wrote:
> On 5/25/06, Bruno Wolff III <bruno@wolff.to> wrote:
> >On Thu, May 25, 2006 at 16:07:19 -0400,
> >  Merlin Moncure <mmoncure@gmail.com> wrote:
> >> been doing a lot of pgsql/mysql performance testing lately, and there
> >> is one query that mysql does much better than pgsql...and I see it a
> >> lot in normal development:
> >>
> >> select a,b,max(c) from t group by a,b;
> >>
>
> >SELECT DISTINCT ON (a, b) a, b, c FROM t ORDER BY a DESC, b DESC, c DESC;
>
> that is actually slower than group by in my case...am i missing
> something? (both essentially resolved to seq_scan)

If there aren't many c's for each (a,b), then a sort might be the best way to
do this. I don't remember if skip scanning ever got done, but if it did, it
would have been 8.1 or later.

pgsql-performance by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: is it possible to make this faster?
Next
From: Tom Lane
Date:
Subject: Re: is it possible to make this faster?