db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: Selecting first N rows of a result set
Date Thu, 15 Dec 2005 19:01:35 GMT

Please post your SQL and JDBC code. That might make it possible to us
to see whay you have performance problems.

Generally in JDBC, the way to limit the number of rows returned from a
query is stmt.setMaxRows(N).

>>>>>>>>>>>> J.English@bton.ac.uk wrote (2005-12-15 14:46:13):
> I know this has been asked before, but I haven't been able to locate
> the answer, so can anyone supply me with at least a link to it? I
> have a table (currently about 5000 rows, each fairly large) and I
> select some or all of those (by default, all of them, and I can then
> refine it down), but I display the selected rows in pages of 20 at a
> time. It's getting horribly slow now the table has grown, and I
> wonder if selecting just 20 rows rather than a result set of 5000
> will give me more acceptable performance...
> TIA,
> -----------------------------------------------------------------
>  John English              | mailto:je@brighton.ac.uk
>  Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
>  School of Computing & MIS | ** NON-PROFIT CD FOR CS STUDENTS **
>  University of Brighton    |    -- see http://burks.bton.ac.uk
> -----------------------------------------------------------------

Bernt Marius Johnsen, Database Technology Group, 
Sun Microsystems, Trondheim, Norway

View raw message