You're not going to get anywhere using Postgres for this kind of task.
Especially if you have millions of products like we do in our database.
We switched to using Solr for our search indexing and querying. It's
way faster than Postgres for obtaining counts like you need. We still
fetch the
Hi, this is basically what I would like to improve :
1) A user searches for a product on category and location.
a) The query is run and the result (limit 30) are returned and shown.
b) The same query is ran again but now I return the count on how many
matches there was totally. (This has to be pos