From: Tomasz Rybak <bogomips@post.pl>
To: Craig A. James <cjames@modgraph-usa.com>
Cc: Kishore B <kishorebh@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Need help in setting optimal configuration for a huge
Date: Sun, 23 Oct 2005 19:17:56 +0200
Message-ID: <1130087877.6708.16.camel@localhost.localdomain> (raw)
In-Reply-To: <435BBAF0.8080500@modgraph-usa.com>
References: <42567e060510221415r2516523l4c3f9b42dee91a09@mail.gmail.com>
<435BBAF0.8080500@modgraph-usa.com>
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@post.pl>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: bogomips@post.pl, cjames@modgraph-usa.com, kishorebh@gmail.com
Subject: Re: Need help in setting optimal configuration for a huge
In-Reply-To: <1130087877.6708.16.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox