Fixing Issues Where Postgres Optimizer Ignores Full Text Indexes

When I attempted to implement faceted search against a Postgres full-text index, I found I had issues getting Postgres (9.2) to pick up the index: CREATE INDEX search_idx2 ON data2 USING gin(to_tsvector(‘english’, search)); SELECT * FROM ( SELECT author, count(*) c FROM data2 WHERE search @@ to_tsquery(‘linux’) GROUP BY author ) counts ORDER BY c …