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,

--
Regards

Shanshan

School of Computing
National University of Singapore