3 ms·
I remember reading your article on FTS in postgres, great stuff. Was wondering what strategies you might be using to perform counts on your data? I'm trying to
by aldoushuxley001 7y ago
I remember reading your article on FTS in postgres, great stuff. Was wondering what strategies you might be using to perform counts on your data?
I'm trying to implement a faceted search in postgres and currently using window functions to count subcategories (a la http://akorotkov.github.io/blog/2016/06/17/faceted-search/ http://akorotkov.github.io/blog/2016/06/17/faceted-search/), but not sure if it's the most efficient.
- citilife 7y agoDepends what you want to do, I created a "estimate_count" function to make it much much faster: "SELECT planrows FROM estimate_row('SELECT COUNT(*) ON table WHERE XXX')"
- aldoushuxley001 7y agoThat's actually brilliant. If you're ever looking for something to write about for a new blog post, I would love to learn more about how you implemented that estimate_count function. Thanks for the tip in the right direction tho!