move query and indexing to setup in test