Skip site navigation (1) Skip section navigation (2)

Re: best way to fetch next/prev record based on index

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>,Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>,Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>,pgsql-performance(at)postgresql(dot)org
Subject: Re: best way to fetch next/prev record based on index
Date: 2004-07-28 16:00:25
Message-ID: 87y8l4rujq.fsf@stark.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-performance
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> The only reason the code in parse_expr.c appears new is that the
> functionality used to be in gram.y.

Ah, that was what I was missing. Though it's odd since it seems there was code
in parse_expr.c to handle the "=" case specially.

> I'd like to see this fixed to comply with the spec, but given the lack
> of complaints about the existing behavior over so many years, ripping
> it out meanwhile doesn't seem appropriate.

I tried my hand at this last night and think I did an ok first pass. But I'm
missing one piece of the puzzle to get it to compile.

What do I need to know to be able to construct a List* suitable for passing as
the second arg to make_op() knowing only that I want to create a List* to
represent "=" or "<" or so on?

I also had another question I didn't ask in the other email. In the midst of a
forboth() loop, how would I tell if I'm at the last element of the lists?
Would lnext(l)==NULL do it?

-- 
greg


In response to

Responses

pgsql-performance by date

Next:From: Pierre-Frédéric CaillaudDate: 2004-07-28 16:53:12
Subject: Join performance
Previous:From: Merlin MoncureDate: 2004-07-28 15:38:00
Subject: Re: best way to fetch next/prev record based on index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group