pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: gsstark@mit.edu, pgsql-performance@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: best way to fetch next/prev record based on index
Date: Tue, 27 Jul 2004 20:45:34 -0700 (PDT)
Message-ID: <20040727204057.S28969@megazone.bigpanda.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AEFF@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB34101AEFF@Herge.rcsinc.local>


On Tue, 27 Jul 2004, Merlin Moncure wrote:

> Greg Stark wrote:
> > > > do it for multi-column keys. It seems it would be nice if some
> syntax
> > > > similar to (a,b,c) > (a1,b1,c1) worked for this.
> > Hum. It would seem my intuition matches the SQL92 spec and Postgres
> gets
> > this
> > wrong.
> [...]
> > Even if Postgres did this right I'm not sure that would solve your
> index
> > woes.
> > I imagine the first thing Postgres would do is rewrite it into regular
> > scalar
> > expressions. Ideally the optimizer should be capable of then deducing
> from
> > the
> > scalar expressions that an index scan would be useful.
>
> Wow.  For once, the standard is my friend.  Well, what has to be done?
> :)  Does pg do it the way it does for a reason?  From the outside it
> seems like the planner would have an easier job if it can make a field
> by field comparison.
>
> Would a patch introducing the correct behavior (per the standard) be
> accepted?  It seems pretty complicated (not to mention the planner
> issues).

Given the comment on make_row_op,
  /*
   * XXX it's really wrong to generate a simple AND combination for < <=
   * > >=.  We probably need to invent a new runtime node type to handle
   * those correctly.  For the moment, though, keep on doing this ...
   */
I'd expect it'd be accepted.




view thread (34+ messages)  latest in thread

Message-ID: <20040727204057.S28969@megazone.bigpanda.com>
Permalink:  ../20040727204057.S28969@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040727204057.S28969@megazone.bigpanda.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: sszabo@megazone.bigpanda.com, merlin.moncure@rcsonline.com, tgl@sss.pgh.pa.us
  Subject: Re: best way to fetch next/prev record based on index
  In-Reply-To: <20040727204057.S28969@megazone.bigpanda.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