modify the query pattern to generate fewer invalid plans