Stop the expansion of decision trees for fixed slice patterns as soon as possible

Fixes #17877.