db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: Server side cursor
Date Thu, 02 Jun 2005 21:28:55 GMT

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

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
                                 Check out Swazoo Koolak's Web Jukebox at

View raw message