Replies: 1 comment 3 replies
-
Have you tried using bounded counting instead? Usually, that works quite well when you e.g. count up to 501, you can show in your UI that there are 500+ elements available. There is also a way to extract a count query to determine the exact count on demand if needed. This code is not intended to be extended by users since it touches all of the internals. Reducing a query to the bare minimum that still produces the correct count is a somewhat complex task, which you already noticed by looking at the code 😄 How would you estimate the count? Maybe we can add that to Blaze-Persistence so that others can also benefit from this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Application use postgres as database and has a simple list view with pagination.
But the data volume is quite large (about 30 million), a simple select and count sql can take more than 10 seconds to return.
After some investination found that, doing exact count is a expensive task because of MVCC. So I decide to return the estimate count when data volume is large
Seems like if I override AbstractFullQueryBuilder#buildPageCountQueryString and create my own
counting sql
to return the esmmitate count and imporve performanceBut the logic in AbstractFullQueryBuilder#buildPageCountQueryString is really complex 😨, any suggestion to allow me implement a estimate version of
couting sql
Thanks
Beta Was this translation helpful? Give feedback.
All reactions