FED-32: Port tryOptimizeSubselectionWithFragments
#5195
Merged
tryOptimizeSubselectionWithFragments
#5195