This article describes how trgm, a powerful plugin significantly improves text search performance for fuzzy prefix and suffix queries as well as regexp matching.