Doug,
You can use the (ISTAT('TOTALREADS')) function to experiment and note the
results.
Emmitt Dove (Not Bill)
Converting Systems Architect
Evergreen Packaging, Inc.
[email protected]
(203) 214-5683 m
(203) 643-8022 o
(203) 643-8086 f
[email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Doug
Hamilton
Sent: Thursday, December 09, 2010 13:08
To: RBASE-L Mailing List
Subject: [RBASE-L] - LIKE vs CONTAINS on indexed column
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