3 ms·
I've implemented a facet search in Postgres for an application where the number of documents is reasonably limited, and for that purpose it worked very well. C
by fabian2k 9y ago
I've implemented a facet search in Postgres for an application where the number of documents is reasonably limited, and for that purpose it worked very well.
Calculating the counts for each facet was by far the most expensive part of the query. I found the GROUPING SETS feature very useful to calculate a lot of aggregate counts efficiently. Though this wasn't parallelized by Postgres, I'll have to check if that is possible in Postgres 10 now.
I wondered if there are better ways to calculate facet counts, but I simply can't think of a way that doesn't require at least one full table scan.
- simonw 9y agoI think facet counts at scale are probably best handled by Elasticsearch or Solr, but I'd be delighted if a PostgreSQL expert would step in and convince me otherwise based on some of the amazing work that went into PostgreSQL 10.