Hi All,
I created one database of 1GB in size, and have a batch of *read-only*queries to be performed. Each query is quite simple, so there is not much room to improve. All the queries are executed through *XQJ api.*
If these queries are sequentially executed, it costs 5~8 seconds per query.
To speed it up, I tried to executed it in a multi-thread way. But turns out to be much slower than the sequential one.
This is what I wrote for each thread:
public void run() { try { XQConnection conn = ds.getConnection(); XQSequence rs = conn.prepareExpression(input) .executeQuery(); //process the query result conn.close(); } } catch (Throwable e) { e.printStackTrace(); } }
Anyone has the idea on how to improve the batch of queries.
Thanks,
Hi Shanshan,
thanks for writing to the list.
I created one database of 1GB in size, and have a batch of read-only queries to be performed. Each query is quite simple, so there is not much room to improve.
Does your query return large results? Could you please give us an example of one of your queries?
All the queries are executed through XQJ api. If these queries are sequentially executed, it costs 5~8 seconds per query.
This sounds pretty slow. Have you compared the performance with the time required by the BaseX GUI or the command-line?
To speed it up, I tried to executed it in a multi-thread way. But turns out to be much slower than the sequential one.
This could be due to the fact that concurrent read operations lead to random disk access patterns. I assume that your queries lead to much disk I/O?
Christian
basex-talk@mailman.uni-konstanz.de