List, please refresh my memory.
I have an indexed column named CustPO. When updating, which will be faster:
WHERE CustPO LIKE 'MP000*'  or
WHERE CustPO CONTAINS 'MP000*'  or
something else?
MP000  is at the beginning of the text in the column.

The full clause is:
WHERE +
 T1.CusPnbr = T2.CusPnbr AND +
 T1.StatCode = 'T' AND +
 T2.CUSTPO LIKE 'MP0000*'

CusPnbr are PK & FK; I assume that should be the first condition in the WHERE clause.
StatCode can have one of 5or 6 values, so it is not indexed.
Would parenthesis help anywhere?

Now that I've thought this through, this might be an improvement, assuming the conditions are evaluated in the order listed, but there were caveats to that also (I think):
WHERE +
 T1.CusPnbr = T2.CusPnbr AND +
 T2.CUSTPO LIKE 'MP0000*' AND +
 T1.StatCode = 'T'

I know this question comes up every year or so - I apologize for the redundancy.

TIA (Bill),
Doug


Reply via email to