• Thank You so much for this article.

    It indirectly solved a long standing performance problem I have with a third party application.

    There are 2 queries with useless Where clauses with likes and <> ''

    and an order by clause on LEN(fieldname) Desc.

    The queries have no chance of using any index at all. The table has grown to over 80,000 records. The procedure executes around 20,000 each day.

    I had suggested adding a computed column to the table many months ago but was told we are not allowed to change the source.

    So after reading your article I created a view with schemabinding on the table in question only on the required fields for the queries and added the computed column LEN(FieldName)

    Then created an unique clustered index on the computed column of the view.

    Overall cost of the query has dropped from 3.5998 to 0.00315. Wow it has saved us 30% to 50% CPU since implementing the view. And best of all I have not touched their code!

    Now do I bother telling the Software vendor???

    Regards