This works for column indexes but there needs to be a separate test for general indexes of expressions (which can also contain a simple column as part of a compound key also having a general expression component. See PlanAssembler.handleOrderBy for how indexExpressions is initialized and processed. In your case, you will be searching it for a TVE with the correct column name.