String comparison............... [message #4400] |
Thu, 05 December 2002 01:25 |
BABU SRSB
Messages: 42 Registered: June 2002
|
Member |
|
|
Hi,
in string comparision, which operator is better in which '=' or 'like' operators.
If i use like operator, is that any performance issue.
Please, clarify me about this.
Regards,
Babu
|
|
|
Re: String comparison............... [message #4411 is a reply to message #4400] |
Thu, 05 December 2002 10:40 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
Assuming an index exists on the column, the answer depends on the distribution of the data and the specific string used with LIKE.
An equality check and LIKE 'xxxxxxxxxx%' should be fairly comparable as long as the criteria is long enough to be significant (LIKE 'x%' will bring many more matches).
You'll end up with full-table scans if you use LIKE and the % sign at the beginning of your criteria (LIKE '%xxxxxxxx').
|
|
|
|