Multi-threaded query