Small tweaks to the query planner to get it to try harder to use an index
for sorting and to avoid using automatic indexes on constant terms.