Hacker News new | ask | show | jobs
by ris 1268 days ago
This is one way to do it.

You might also be able to denormalize the categories down to an integer-array column and build a GIN or GiST index on that. I'd probably use triggers to automatically keep the integer-arrays up to date, but there are a number of ways it could be done if you don't like triggers.