Query reduction for variant generation