pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-sql@postgresql.org
Subject: Re: Two Index Questions
Date: Fri, 19 Jul 2002 11:12:49 -0700
Message-ID: <200207191112.49885.josh@agliodbs.com> (raw)
In-Reply-To: <20020719175638.GA14836@wolff.to>
References: <200207190933.59283.josh@agliodbs.com>
	<200207191028.18547.josh@agliodbs.com>
	<20020719175638.GA14836@wolff.to>

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 Berkus
 Aglio Database Solutions
 San Francisco




view thread (10+ messages)  latest in thread

Message-ID: <200207191112.49885.josh@agliodbs.com>
Permalink:  ../200207191112.49885.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200207191112.49885.josh@agliodbs.com

 · 

reply

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-sql@postgresql.org
  Cc: josh@agliodbs.com, bruno@wolff.to
  Subject: Re: Two Index Questions
  In-Reply-To: <200207191112.49885.josh@agliodbs.com>

* 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