Loosely inspired from this old blog post.
Anecdotical benchmark: against our whole Geonames-derived table of locations (3.2M records, about 1GB of data), on my development machine (a 2011 MacBook Pro)
- searching for the top 10 matching records takes 6ms ±1
- preparing the index for all records takes about 10min
- the DB query overhead when changing a record is at 3ms ±2
- the memory overhead (footprint of the trigrams table index) is about 300MB
This looks like it scales very well, since the total number of possible trigrams is low (about 19k).
Pretty fast if you ask me!