Search Postgresql Archives

Re: How do I use the backend APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   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.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux