pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: pgsql-performance@postgresql.org
Cc: Greg Stark <gsstark@mit.edu>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: best way to fetch next/prev record based on index
Date: 29 Jul 2004 13:57:55 -0400
Message-ID: <877jsmr90c.fsf@stark.xeocode.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AF0F@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB34101AF0F@Herge.rcsinc.local>


"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:

> Well, if and when the rowtype comparison can be made to work over multi
> part keys (and the optimizer is made to do tricks there), postgres can
> be made to give much better generalized ISAM access.  In the meantime,
> I'll just troubleshoot specific cases via application specific behavior
> as they come up.  In any case, many thanks to Greg and Tom for taking
> the time to pick this apart.

Well I'm not sure whether you caught it, but Tom did come up with a
work-around that works with the current infrastructure if all the columns
involved are the same datatype.

You can create a regular btree index on the expression array[a,b,c] and then
do your lookup using array[a,b,c] > array[a1,b1,c1].

This will only work in 7.4, not previous releases, for several reasons.

-- 
greg




view thread (34+ messages)  latest in thread

Message-ID: <877jsmr90c.fsf@stark.xeocode.com>
Permalink:  ../877jsmr90c.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/877jsmr90c.fsf@stark.xeocode.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-performance@postgresql.org
  Cc: gsstark@mit.edu, merlin.moncure@rcsonline.com, tgl@sss.pgh.pa.us
  Subject: Re: best way to fetch next/prev record based on index
  In-Reply-To: <877jsmr90c.fsf@stark.xeocode.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