开发者

Parallel query in HSQLDB

is it possible to run query in parallel with HSQLDB? As i couldn't fi开发者_StackOverflownd anything in documentation, I suppose that optimizer has no parallelism included. But how about multiple database connections? Assume I have 2 threads working (and 2 cores available), each of them has a "private" (separate) connection to the database, and each of them tries to execute a different query (a query to a different table). Would such queries be executed in parallel?


HSQLDB 2.x is fully multithreaded and executes such queries in parallel.

In general, each thread executes queries separately from other threads. The transaction manager checks table and row access for each statement and introduces waits for the current thread if necessary only when another connection has modified the table or row in question, otherwise it allows the connection thread to proceed. If your statements do not modify data, multiple threads can query the same table or rows simultaneously.

The waits are introduced at table level in the LOCKS mode and at row level in the MVCC mode.

See the HSQLDB Gide http://hsqldb.org/doc/2.0/guide/sessions-chapt.html#snc_tx_tx_cc

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜