Skip site navigation (1) Skip section navigation (2)

Re: Need help in setting optimal configuration for a huge

From: Tomasz Rybak <bogomips(at)post(dot)pl>
To: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
Cc: Kishore B <kishorebh(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Need help in setting optimal configuration for a huge
Date: 2005-10-23 17:17:56
Message-ID: 1130087877.6708.16.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-performance
Dnia 23-10-2005, nie o godzinie 09:31 -0700, Craig A. James napisaƂ(a):
<cut>
> MIN() and MAX() -- These are surprisingly slow, because they seem to do a full table scan EVEN ON AN INDEXED COLUMN!
In 8.1 this is no true, see the changelog.

> I don't understand why, but happily there is an effective substitute:
> 
>    select mycolumn from mytable order by mycolumn limit 1;  -- same as MIN()
> 
>    select mycolumn from mytable order by mycolumn desc limit 1;  -- same as MAX()

In 8.1 these queries are equivalent:

select mycolumn from mytable order by mycolumn limit 1;
select min(mycolumn) from mytable;

-- 
Tomasz Rybak <bogomips(at)post(dot)pl>


In response to

pgsql-performance by date

Next:From: Josh BerkusDate: 2005-10-23 21:02:35
Subject: Re: Using LIMIT 1 in plpgsql PERFORM statements
Previous:From: Tom LaneDate: 2005-10-23 17:06:07
Subject: Re: Need help in setting optimal configuration for a huge

pgsql-admin by date

Next:From: Kishore BDate: 2005-10-23 21:35:38
Subject: Re: Need help in setting optimal configuration for a huge database.
Previous:From: Tom LaneDate: 2005-10-23 17:06:07
Subject: Re: Need help in setting optimal configuration for a huge

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group