speed up slow queries with indices