Don't Overuse Wildcards

The SQL wildcard characters are invaluable in performing flexible text searches – they allow for the creation of powerful applications that might otherwise be impossible to write. But that power comes with a hefty price tag – wildcard searches tend to be among the slowest SQL operations (because more often than not using a wildcard precludes the use of indexes). So, use wildcards when you need them, but don’t overuse them – if there is an alternate way to perform the search (and if you can avoid using them at the start of the search pattern) you should do so. (Applies to: ColdFusion All)

Leave a Reply