Hi,
1) try HashSet instead of List for id storing (for faster lookups);
2) try to use MERGE command instead of seeking ids in your collection
(instead of previous suggestion)
3) try PRIMARY KEY HASH (it also uses HashMap for lookups);
4) try to add heap memory as much as possible (to decrease GC
pressure)

If this still too slow look at TableEngine api to implement your own
table.

regards,
Sergi

On 19 авг, 02:28, thebbk <the...@yahoo.com> wrote:
> I am using H2 as an embedded database in a Java 1.6 application. The
> Database is in-memory. I create a single table using 'CREATE MEMORY
> TABLE TestTable'. I have an index on what we call our ID field and put
> this at the end of the table creation sql: 'PRIMARY KEY (id)'
>
> The purpose of the application is to receive objects from a type of
> stream. Each object is converted into an INSERT, UPDATE or DELETE sql
> statement depending on whether or not the object (record) exists. I
> use a java.util.List to hold the list of ID's in the database - so I
> don't have to query the database every time to see if the record
> exists.
>
> The rate at which these objects are being received from the stream is
> fairly high, and there are 41 fields of varchar's and numerics.
>
> Essentially, the application takes the objects from the stream and
> places them into a queue where a thread pulls each object off the
> queue and executes the sql statement on the database. Pretty straight
> forward.
>
> As the application runs, I monitor the application and see that the
> queue is always backed up to varying degrees.
>
> There are roughly 225k-250k records.
>
> Given that I have an index on our id field and the table is a memory
> table in a memory database, are there any other settings I should look
> at to try to improve the rate at which the data is inserted or updated
> in the database? Most of the activities are updates.
>
> I am using Java 1.6 and currently running this in 64-bit Java on
> Solaris 10. If there are JVM settings which might improve performance,
> I'd like to hear suggestions.
>
> Thanks!

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

Reply via email to