Removing superflous query