You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Satheesh Bandaram <sa...@Sourcery.Org> on 2005/06/01 12:17:42 UTC

Re: Server side cursor

By "server-side cursors", do you mean the ability to process on the
server, using procedures/functions? Same cursor mechanism works on the
server too. See if 'Derby server-side programming' part in developer
guide provides more info:

http://incubator.apache.org/derby/docs/devguide/cdevspecial.html

Satheesh

Edson Carlos Ericksson Richter wrote:

> Thanks.
>
> I made a fgrep -iR "server side" * in docs and found nothing about it.
> a fgrep -iR "cursor" * found several docs, but none specific about
> server side cursors.
>
> Even a fgrep -iR "cursor" | egrep -i "server" reveal no doc about
> server side cursor.
>
> May be the terminoly I'm looking for is wrong. Under what name server
> side cursor subject could be find?
>
> Thanks again,
>
> Edson Richter
>
>
>
> Satheesh Bandaram escreveu:
>
>> Derby certainly can. Data for cursors in Derby is fetched on demand.
>> Check Derby documentation for more info.
>>
>> Satheesh
>>
>> Edson Carlos Ericksson Richter wrote:
>>
>>  
>>
>>> Is derby able to delivery very large resultsets (really bigger than
>>> phisical memory of the db server) throught server side cursors?
>>>
>>> Thanks,
>>>
>>>   
>>
>>
>>
>>
>>  
>>
>
>


Re: Server side cursor

Posted by Jeffrey Lichtman <sw...@rcn.com>.
>. . . if I issue a very large, expensive select * from huge_table, if I 
>have server side cursors, response is immediate, because there is nothing 
>to process. My cursor is just a pointer to real data in the table.
>
>Even if I make a select * from huge_table order by some_column, if the 
>column is indexed, the server-side cursor is just a pointer to index... 
>And real action goes when I scroll records...
>
>Richter

This is what Derby does. In most cases Derby does not materialize a result 
set when a cursor is opened. There are exceptions when the query uses ORDER 
BY, GROUP BY, DISTINCT or aggregates (e.g. sum), but even in these cases 
Derby uses a backing store rather than forcing all the result rows to stay 
in memory. In cases where it is possible to avoid sorting for an ORDER BY 
clause, the Derby optimizer decides whether to sort or not based on 
estimated cost.


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/ 


Re: Server side cursor

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
Yes, that's what I have in mind.

See, if I issue a very large, expensive select * from huge_table, if I 
have server side cursors, response is immediate, because there is 
nothing to process. My cursor is just a pointer to real data in the table.

Even if I make a select * from huge_table order by some_column, if the 
column is indexed, the server-side cursor is just a pointer to index... 
And real action goes when I scroll records...

Thanks for clarification.

Richter


Satheesh Bandaram escreveu:

> Thinking about this some more, may be you mean SQL cursors by 
> "server-side cursors". These are definitely not supported by Derby. 
> Derby only has JDBC based cursors. SQL cursors didn't leap to my head, 
> since Derby doesn't have them.
>
> Satheesh
>
> Satheesh Bandaram wrote:
>
>>By "server-side cursors", do you mean the ability to process on the
>>server, using procedures/functions? Same cursor mechanism works on the
>>server too. See if 'Derby server-side programming' part in developer
>>guide provides more info:
>>
>>http://incubator.apache.org/derby/docs/devguide/cdevspecial.html
>>
>>Satheesh
>>
>>Edson Carlos Ericksson Richter wrote:
>>
>>  
>>
>>>Thanks.
>>>
>>>I made a fgrep -iR "server side" * in docs and found nothing about it.
>>>a fgrep -iR "cursor" * found several docs, but none specific about
>>>server side cursors.
>>>
>>>Even a fgrep -iR "cursor" | egrep -i "server" reveal no doc about
>>>server side cursor.
>>>
>>>May be the terminoly I'm looking for is wrong. Under what name server
>>>side cursor subject could be find?
>>>
>>>Thanks again,
>>>
>>>Edson Richter
>>>
>>>
>>>
>>>Satheesh Bandaram escreveu:
>>>
>>>    
>>>
>>>>Derby certainly can. Data for cursors in Derby is fetched on demand.
>>>>Check Derby documentation for more info.
>>>>
>>>>Satheesh
>>>>
>>>>Edson Carlos Ericksson Richter wrote:
>>>>
>>>> 
>>>>
>>>>      
>>>>
>>>>>Is derby able to delivery very large resultsets (really bigger than
>>>>>phisical memory of the db server) throught server side cursors?
>>>>>
>>>>>Thanks,
>>>>>
>>>>>  
>>>>>        
>>>>>
>>>>
>>>> 
>>>>
>>>>      
>>>>
>>>    
>>>
>>
>>  
>>


-- 
Edson Carlos Ericksson Richter
MGR Inform�tica Ltda.
Fones: 3347-0446 / 9259-2993