Re: SELECT queries stalling insert/update on table

150 views
Skip to first unread message

Thomas Mueller

unread,
Jul 16, 2012, 2:43:13 AM7/16/12
to h2-da...@googlegroups.com
Hi,

The best solution would be to speed up the queries of course. If you can't do that:

By default, H2 does not execute multiple statements concurrently. You would have to enable multi-threading by appending ";MULTI_THREADED=TRUE" to the database URL (see the docs).

Regards,
Thomas


On Tuesday, July 10, 2012, abhi wrote:
We are using H2 in-memory database for a application, which has 500+ insert/updates per second operation on a single table. The application is expected to eventually handle 2000+ insert/update per second. 

It is observed that SELECT queries, which takes long time (say 2+ seconds) to execute, stall insert/update operations until they have not completed execution.

We do not want  SELECT queries to block insert/update operations on the table. To achieve concurrency, I tried different configurations such as LOCK_MODE=3 or MVCC=TRUE. However, they do not fix the issue.

I would like to know if there is a way to run concurrent select and insert/update operation on the table?

We are using 1.3.xxx version of the H2 database.

--
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/-/7BtvkpJOpQ8J.
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.

abhi

unread,
Jul 24, 2012, 12:44:32 AM7/24/12
to h2-da...@googlegroups.com
I was able to speed the execution of queries by adding indexes.
Also, I added MULTI_THREADED=TRUE to the database URL. However, I am still observing that whenever SELECT queries take sometime for execution, the insert/update operation on the table stalls. Was wondering whether the  implementation of H2 database is single-threaded behind the scene.
To unsubscribe from this group, send email to h2-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages