newbie question: processing large database in chunks?
- From: cerios <nospam@xxxxxxxxxx>
- Date: Mon, 23 Jan 2006 22:09:11 -0800
Hi,
When I
select * from XX
I'm geting an OutOfMemoryError. I'm using JDBC with Mysql,
and calls like:
ResultSet rs = dbc.executeQuery("select * from thetable");
My beginner's question: what's the right way to read and process the
table in chunks, to avoid running out of memory?
Is using LIMIT n1,n2 inside the query the right thing to do, giving
e.g. LIMIT 1,100 followed by another query using LIMIT 101,200, etc?
Is there a more efficient way?
I guess I'm surprised that it's even necessary. I would have thought
that the data would stay on the server until pulled to the client
by resultset.next() and a resultset.getXX(). But evidently
the whole table is being sent to the client??
.
- Follow-Ups:
- Re: newbie question: processing large database in chunks?
- From: Mladen Adamovic
- Re: newbie question: processing large database in chunks?
- From: Boris Stumm
- Re: newbie question: processing large database in chunks?
- Prev by Date: Cascading Updates In Derby Query?
- Next by Date: Re: newbie question: processing large database in chunks?
- Previous by thread: Cascading Updates In Derby Query?
- Next by thread: Re: newbie question: processing large database in chunks?
- Index(es):
Relevant Pages
|
|