topic query optimise