Databases · Middle · Question 4 of 75

Why can't a normal B-tree index speed up WHERE name LIKE '%son'?

Explanation

LIKE 'son%' can use a B-tree (with a suitable operator class). For substring or fuzzy search use a trigram GIN index (pg_trgm) or full-text search.

Further reading

Problem with a question

Databases · Middle · question 4

Test yourself

Take the Databases · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz