Re: MOVE in SQL vs PLPGSQL

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: MOVE in SQL vs PLPGSQL
Дата
Msg-id 87u0fu5qj4.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: MOVE in SQL vs PLPGSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Richard Huxton <dev@archonet.com> writes:
> > Ah, now I see what you're saying. You're quite right in your suspicions, 
> > "MOVE..." isn't supported for plpgsql cursors. You could probably do 
> > something with EXECUTE and returning a refcursor from a previous 
> > function, but that sounds fiddly.
> 
> > I must admit, on the odd occasion I want to skip a row, I just FETCH it 
> > and move on. Anyone else?
> 
> There is something on the TODO list about improving plpgsql's cursor
> functionality --- there's no reason it shouldn't have MOVE, except that
> no one got around to it yet.

Though the original poster should realize, a MOVE command would be only
marginally more efficient than just fetching those records. It would save the
network overhead and context switches involved in communicating those records,
but there's no way it would let the server avoid reading all those records
from disk.

At least as far as I can see.

-- 
greg



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

Предыдущее
От: Hector Rosas
Дата:
Сообщение: Selecting records not present in related tables
Следующее
От: Frank Bax
Дата:
Сообщение: Re: Selecting records not present in related tables