pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: is it possible to make this faster?
Date: Thu, 25 May 2006 15:47:46 -0500
Message-ID: <20060525204746.GA26341@wolff.to> (raw)
In-Reply-To: <b42b73150605251331l85a1403pbf4c73656b6194bc@mail.gmail.com>
References: <b42b73150605251307id0e7998td4a3693f0d456f88@mail.gmail.com>
	<20060525202314.GA20747@wolff.to>
	<b42b73150605251331l85a1403pbf4c73656b6194bc@mail.gmail.com>

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.



view thread (25+ messages)  latest in thread

Message-ID: <20060525204746.GA26341@wolff.to>
Permalink:  ../20060525204746.GA26341@wolff.to/
Also on:    postgresql.org/message-id/20060525204746.GA26341@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, mmoncure@gmail.com
  Subject: Re: is it possible to make this faster?
  In-Reply-To: <20060525204746.GA26341@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox