Re: Two Index Questions - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Two Index Questions
Date
Msg-id 200207191112.49885.josh@agliodbs.com
Whole thread Raw
In response to Re: Two Index Questions  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Two Index Questions  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Two Index Questions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Bruno, Tom,

> Typo. I meant to say columns. The issue is that max doesn't use an index,
> but if there are a lot of different values of G for a given A, B and C,
> it may be better to use an index then to search through the applicable
> rows to find the maximum.

That's odd ... you're correct.   Tom, why doesn't MAX() use an index?   I
understand why indexes are generally useless for SUM(), AVG, and COUNT, but
it seems that MAX() and MIN() should *always* use an index.

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Two Index Questions
Next
From: Bruce Momjian
Date:
Subject: Re: Two Index Questions