Hi,

I have a table of 400,000 rows roughly, where each row has a (unique)
integer field (say, a periodic "timestamp" value whose granularity is
know in advance), and the other columns are 100 columns containing
integers.

So the table schema is something like:

     | id (auto generated) |  timestamp |  col_1  |  col_2 |  ....   |
col_100 |

I have also created an index on the 'timestamp' column:

    CREATE INDEX idx_timestamp ON my_table_name (timestamp)


In my application then I have to basically read in order each row of
this table, and for each row perform an operation (which take some
little time, but not a huge time).

I was wondering than what is the best strategy to read the rows, such
that the DB does not become my bottleneck.

As far as I understand, there are no real cursors in H2, so my idea
would be to keep 1 JDBC Connection open, compile a PreparedStatement
at the beginning with the "start" and "end" range of consecutive
'timestamp' values to consider, and fetch some N rows, process each
one of them. When done fetch again the next N rows, and so on.

Could someone provide some feedback on this strategy, or propose how
to leverage the best out of H2 capabilities to perform this task?

Thanks a lot in advance.
--
Alessio Pace

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to