Re: Index not being used in MAX function (7.2.3) - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Index not being used in MAX function (7.2.3)
Date
Msg-id 20030613223649.GW40542@flake.decibel.org
Whole thread Raw
In response to Re: Index not being used in MAX function (7.2.3)  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Index not being used in MAX function (7.2.3)  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
On Fri, Jun 13, 2003 at 03:58:13PM -0500, Bruno Wolff III wrote:
> > You can use multiple indexes per query plan node? IE: if you have
> > indexes on a and b, you can use both indexes when you do WHERE a=blah
> > and b=foo? That's what I was reffering to...
>
> I think what you are describing doesn't make much sense. On any scan
> you are only going to using one index (possibly over several columns).

I believe MSSQL and Oracle support it; they scan the indexes then grab
the appropriate set of matching tuple addresses. The advantage you get
from this is you can get close to multi-key index performance without
using multi-key indexes. This is useful when you need to do lookups on
two different fields in a table, and also need to do lookups on both
fields. IE:

select ... where a=foo;
select ... where b=bar;
select ... where a=blah and b=baz;

I was strictly looking to the future when pgsql migth eventually support
this. :)
--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Next
From: Alvaro Herrera
Date:
Subject: Re: full featured alter table?