Re: Astonishing explain...!

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: Mike Harding <mvh(at)ix(dot)netcom(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Astonishing explain...!
Date: 2002-06-25 04:30:58
Message-ID: 200206250430.g5P4UwA03331@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Neil Conway wrote:
> 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.

Well, an FAQ item as of yesterday anyway. ;-)

> 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
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>
>

--
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

Browse pgsql-general by date

  From Date Subject
Next Message Suraj Peri 2002-06-25 04:54:01 Re: How can i create an object in Postgres
Previous Message Hiroshi Inoue 2002-06-25 03:45:45 Re: SQL server application porting headache