Read-only and multi threading

70 views
Skip to first unread message

Guillaume

unread,
Jun 11, 2012, 5:11:54 AM6/11/12
to h2-da...@googlegroups.com
Hello, 

I have a database (approx. 2200 tables with 500 lines each, 50Mb) that need to be accessed by several threads (4 or 6 for example). There is a lot of calculations to do on this database and it takes about 15 hours, so it needs to be very fast.

I already tried read-only mode with multi threading (MULTI_THREADED=TRUE, ACCESS_MODE_DATA=r) as threads only read the data and write the result in an other database.
But is there other ways to improve performances ? For example, I think there is no need to "lock" the database as it is read only (but maybe I misunderstood something here). Should I use FILE_LOCK=NO or LOCK_MODE=0 ? (actually using lock_mode=0 in the url throw an error n° 90133 CANNOT_CHANGE_SETTING_WHEN_OPEN).

Is there any other way to improve reading performances for read only database ? 
I will also try to put this DB in-memory. But does this improvements also applies to in-memory DB ? 

Thank you for your advices.
Guillaume

Thomas Mueller

unread,
Jun 13, 2012, 1:46:14 PM6/13/12
to h2-da...@googlegroups.com
Hi,

Whatever you try to do here, don't use FILE_LOCK=NO. It doesn't do
what you want (see the docs).

What you should do first is to use a profiler to find out where the
bottleneck is. See
http://h2database.com/html/performance.html#built_in_profiler

Regards,
Thomas
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/kWH6r0SZGW4J.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.

Guillaume

unread,
Jun 13, 2012, 4:37:51 PM6/13/12
to h2-da...@googlegroups.com
Hi, 

Thank you for your answer, I clearly misunderstood something here !
And I will take a look at the profiler.

Regards.
Guillaume
Reply all
Reply to author
Forward
0 new messages