Re: Incorrect cursor behaviour with gist index - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Incorrect cursor behaviour with gist index
Date
Msg-id 10496.1224276661@sss.pgh.pa.us
Whole thread Raw
In response to Re: Incorrect cursor behaviour with gist index  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: Incorrect cursor behaviour with gist index
Re: Incorrect cursor behaviour with gist index
List pgsql-hackers
Teodor Sigaev <teodor@sigaev.ru> writes:
>> Seems like a lotta work for a partial solution :-(.  Probably the path
>> of least resistance is to teach the planner that only some index AMs can
>> do backwards scan.  That would result in a Materialize buffer getting
>> placed in front of the query if the user demanded scroll capability,
>> but it would cost nothing in the more typical case where backwards scan
>> isn't needed.

> Probably, it will be a better solution. In this case GiST code could be 
> simplified - remove support of backward scan (in any case not fully workable)

Okay.  I'll go fix the core code, and you can take out whatever you want
in GiST/GIN.

BTW, I think that the support for ammarkpos/amrestrpos in these two AMs
is pretty much useless code as well.  We only use mark/restore in merge
joins, and so it only needs to be supported by plan nodes that can
deliver sorted output, which GiST/GIN indexscans can't.  Furthermore,
even if we had another use for the facility, it'd be pretty questionable
to use it when the AM can't guarantee to return the same sequence of
tuples after backing up.  So I think it would be sufficient to have
gistmarkpos et al throw error if called.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: Hot Standby: First integrated patch
Next
From: Teodor Sigaev
Date:
Subject: Re: Incorrect cursor behaviour with gist index