When applying the optimization that disables WHERE clause terms that drive
indexes, make sure not to do so if the term being disabled is a transitive
constraint.  Fix for the problem identified by
post eb8613976a].