TEIID-2921 allowing more optimization with complex sorts