title: How to index a string array column for pg_trgm `'term' % ANY (array_column)` query?
body: <p>I have tried an ordinary Postgres <code>gin</code> index as well as the pg_trgm <code>gin_trgm_ops</code> and <code>gist_trgm_ops</code> indexes (using this workaround: <a href="https://stackoverflow.com/a/33016333/283398">https://stackoverflow.com/a/33016333/283398</a>).</p>
  
  <p>However EXPLAIN on my query <code>'term' % ANY (array_column)</code> shows a sequential scan even after having executed <code>set enable_seqscan = off;</code>.</p>
  
  <p>(For my use case, I need partial matches and pg_trgm seems like a much better fit than full-text search because my data is not linguistic. The quality of my pg_trgm results is very good.)</p>
  
  <p>My use case is rows with an array column containing a mix of first names and full names (space-delimited). The search term may be a first, last, or full name (space-delimited). The pg_trgm % operator results are case insensitive and appear to weight highly matches at the beginning and end of the names in the array column, which is great for full names because it finds matching first and last names but not necessarily middle names.</p>
  
  <p><a href="https://github.com/theirix/parray_gin" rel="nofollow noreferrer">https://github.com/theirix/parray_gin</a> is promising, but old, and doesn't claim to support Postgres newer than 9.2.</p>