Speed up queries on text columns using :gin indices with [Rails & PostgreSQL]
Before we start This post assumes that you are aware of database indices and performance benefits they can bring. If not, please check out this link for a quick introduction.
Context Yesterday, I noticed a very slow background process for a rather small task through Appsignal.
Quickly checking the codebase, the problem was because of doing a full text search on a column in the table with over 2+ million records, unindexed.
ramblingcode.dev