Re: Astonishing explain...!

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: "Mike Harding" <mvh(at)ix(dot)netcom(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Astonishing explain...!
Date: 2002-06-24 23:44:11
Message-ID: 20020624194411.49896cf4.nconway@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 24 Jun 2002 08:43:16 -0700 (PDT)
"Mike Harding" <mvh(at)ix(dot)netcom(dot)com> wrote:
> Why is a sequential scan be done for MAX of an indexed column? This
> is obviously pretty painful for large tables...

This is an FAQ -- check the archives for much more discussion of it.
In short, the workaround is to create a btree index on the column
in question, and do:

SELECT num FROM boogers ORDER BY num LIMIT 1;

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kurt at iadvance 2002-06-25 00:08:54 Re: Some Solaris notes, and an invitation
Previous Message Tom Lane 2002-06-24 23:14:25 Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be