Speed up query cloning