multi-threaded query test