Re: not using index for select min(...) - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: not using index for select min(...)
Date
Msg-id 20030201010229.GA14084@wolff.to
Whole thread Raw
In response to not using index for select min(...)  (Don Bowman <don@sandvine.com>)
List pgsql-performance
On Fri, Jan 31, 2003 at 16:12:38 -0500,
  Don Bowman <don@sandvine.com> wrote:
> I have a table which is very large (~65K rows). I have
> a column in it which is indexed, and I wish to use for
> a join. I'm finding that I'm using a sequential scan
> for this when selecting a MIN.
>
> I've boiled this down to something like this:
>
> => create table X( value int primary key );
> => explain select min(value) from x;

Use the following instead:
select value from x order by value limit 1;

pgsql-performance by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: not using index for select min(...)
Next
From: Sean Chittenden
Date:
Subject: Re: not using index for select min(...)