Re: Bad query optimisation

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bad query optimisation
Date: 2002-11-30 23:50:58
Message-ID: 20021130235058.GA19268@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 30, 2002 at 18:23:56 -0500,
Greg Stark <gsstark(at)mit(dot)edu> wrote:
>
> It seems like this should be an important optimization given the number of
> applications that request max(foo) in a broken attempt to implement sequences.
> Occasionally it's not even a broken attempt too.

This has been discussed on the mailing lists many times. You can rewrite
the queries using order by and limit clauses if the column is appropiately
indexed.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-11-30 23:56:29 Odd optimiser behaviour
Previous Message Christopher Kings-Lynne 2002-11-30 23:48:34 Re: Newbie hacker looking to get started