Re: How do I use the backend APIs

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: How do I use the backend APIs
Дата
Msg-id 20060220224021.GG12673@svana.org
обсуждение исходный текст
Ответ на Re: How do I use the backend APIs  ("Chad" <chadzakary@hotmail.com>)
Ответы Re: How do I use the backend APIs  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: How do I use the backend APIs  ("Chad" <chadzakary@hotmail.com>)
Список pgsql-general
On Mon, Feb 20, 2006 at 05:08:33AM -0800, Chad wrote:
> 4. Why I think I need to work at this level of abstraction. I believe,
> certain types of queries can be realized more efficiently by code that
> can seek to specific parts of an index and immediately returning a
> small number of rows to the client. The query would remain active and
> the client would only retrieve the next rows after the previous cursor
> position when the client was ready to do so. With a huge underlying

<snip>

You realise you can acheive almost exactly what you want here by saying
things like:

DECLARE c AS CURSOR FOR select * from table where name >= 'Mal' order by name;
FETCH FORWARD 1;  -- Go down
FETCH FORWARD 1;  -- Go down
FETCH BACKWARD 2; -- Go back again

If you have an index it will just step through the index to find the
rows you want. While you're free to try and make this work by using the
index code directly, you're not asking anything that's otherwise
impossible.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Question about COPY to/from
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: How do I use the backend APIs