Well there would be some sort of minimal performance hit somewhere
detecting if there are wild cards. Of course if there are no
wild cards they will not be evaluated but it still has to
check for their prescence, however if you are just testing
for equality it is going to be a quicker operation just
given that there is less overhead assocaited with it
Either on the CF or SQL side, however since most good SQL
servers will optimize this it should not be much of an issue.
But it will still be somewhat less expensive to test for
equality in terms of processor time. The SQL server *may*
optimize for it, but there is no real way to know without
testing it out.


Jeremy Allen
[EMAIL PROTECTED]
[Insert cool title here]

-----Original Message-----
From: Jim McAtee [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 14, 2000 6:16 PM
To: [EMAIL PROTECTED]
Subject: SQL: Using LIKE with and without a wildcard


As a rule, will their be a performance penalty using LIKE instead of =
in SQL queries if there's NOT a wildcard in the expression?  That is, if
my users have the option of using wildcards in their searches (on
multiple fields), is it better to detect the presence/absence of a
wildcard and adjust the operator accordingly?  I'd hope that most SQL
engines would do this on their own, treating the LIKE operator the same
as = whenever no wildcard is present.

Thanks,
Jim

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to