Solution: Use the Right Tool for the Job

It’s best to use a specialized search engine technology instead of plain SQL pattern-matching conditions.

The following sections describe some of the technologies offered as built-in extensions by different database brands and technologies offered by independent projects. Also, you’ll see a solution that uses standard SQL but is more efficient on average than substring matching.

Vendor Extensions

Every major brand of database has invented their own answer to the common requirement of full-text search. If you use a single brand (or are willing to use vendor-dependent features), these features are the best way to get high-performance text search, with the greatest integration with SQL queries.

Get SQL Antipatterns, Volume 1 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.