Re: Synchronized scans

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Synchronized scans
Дата
Msg-id 27673.1181319722@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Synchronized scans  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: Synchronized scans  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-patches
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> Jeff Davis <pgsql@j-davis.com> writes:
>>> Just to be sure: a backwards-started scan is currently unreachable code,
>>> correct?
>>
>> [ yawn... ]  I think so, but I wouldn't swear to it right at the moment.
>> In any case it doesn't seem like a path that we need to optimize.

> Agreed, let's just disable the reporting when moving backwards.

Now that I'm awake, it is reachable code, per this comment:

 * Note: when we fall off the end of the scan in either direction, we
 * reset rs_inited.  This means that a further request with the same
 * scan direction will restart the scan, which is a bit odd, but a
 * request with the opposite scan direction will start a fresh scan
 * in the proper direction.  The latter is required behavior for cursors,
 * while the former case is generally undefined behavior in Postgres
 * so we don't care too much.

That is, if you run a cursor to the end and then back up, you'll go
through the init-in-the-backwards-direction code.

But we're agreed that we don't want to report when moving backwards,
so this is just an interesting note...

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Synchronized scans
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Synchronized scans