[h2] setFetchSize with large ResultSet embdded mode

2015-12-02 Thread Adam McMahon
H2 Group,

I am trying to understand Statement.setFetchSize with large ResultSets.  
The documentation says that it this function sets the number of rows 
suggested to read in one step. What does it mean by "suggested".  In what 
situations is the setFetchSize value not honored?  

My the situation is the following.  We have a large (and growing) table in 
embedded H2.This is what I would like to do to avoid loading the entire 
contents of myBigTable into memory, either in the ResultSet or somewhere in 
the H2DB layer.

-
statemnet.setFetchSize(10)
results = select * from myBigTable
while (hasMoreResults) 
   processes results.next()


In embedded mode, I want to avoid loading the entire contents of myBigTable 
into memory, either in the H2 DB layer or in the ResultSet My assumption is 
that the above pattern will first buffer the results of myBigTable to disk 
(assuming my table it big enough) , and then (in a chucked format with 10 
at a time via the fetchsize), load the next 10 results and pass it to the 
embedded client.  Thus the entire BigTable will never be fully loaded into 
memory.  Sound correct?

I use latest stable with PageStore.

Thanks,
-Adam

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] setFetchSize with large ResultSet embdded mode

2015-12-02 Thread Noel Grandin

Our default maximum number of rows in a result set we will load into memory is:
   = 4 per GB of available RAM

If you want it to be less, you can explicitly set it on the command line with
  -Dh2.maxMemoryRows=

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.