SyntaxStudy
Sign Up
MySQL Beginner 3 min read

Full-Text vs LIKE

Full-Text vs LIKE

LIKE '%word%' does a full table scan with no ranking. Full-text search uses an inverted index, supports relevance ranking, and is orders of magnitude faster on large tables.

Example
-- Slow: full table scan, no ranking
SELECT * FROM articles WHERE body LIKE '%optimization%';

-- Fast: uses full-text index, ranked by relevance
SELECT *, MATCH(title,body) AGAINST('optimization') AS score
FROM articles
WHERE MATCH(title,body) AGAINST('optimization')
ORDER BY score DESC;
Pro Tip

Use LIKE only for pattern matching on short strings; full-text for natural language search.