-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change getCountQuery methods visibility to protected #11400
base: 3.2.x
Are you sure you want to change the base?
Conversation
|
I want to modify the count query generated by doctrine. If I override |
Ah yes I see. 💡 |
/** | ||
* Returns Query prepared to count. | ||
*/ | ||
protected function getCountQuery(): Query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected function getCountQuery(): Query | |
final protected function getCountQuery(): Query |
I don't think you actually need to override that method, right? Being able to call it from your count()
override and then modifying the result sounds like it would be sufficient.
Retargeting to 3.2.x since this is no bugfix. |
Oh sorry! I just did it on the browser without checking the contribution document. So that is why I created for this branch 🤦
Let me tell you my story. We are using mysql. We have more than 10 tables that have over 30 million rows. And we have filters and lists of these rows. The weird part is here. I couldn't figure out why but a basic For a simple solution, I created a patch file for the doctrine paginator and added I can override the |
So a count query without any where clause takes ~10 seconds? Shouldn't you be fixing that instead? Can you post your issue on https://dba.stackexchange.com/ first? I'm curious to see if this is normal, and if it can be fixed at the database level. |
I will do it but I am not the only one who suffers from this issue. |
Yeah browsing the web, I just could find some other occurrences of this:
Maybe what you could do if you're OK with approximations is override |
I am okay with approximations(I think caching is a kind of approximation) but we can't get an approximation with filters.
It is a really old system that still running and the users of the system accepted their fate already 😞 So waiting for a warmup is okay for them. The cache of the bigger lists will be around 2-3 hours. So one user will be a little bit suffocated per filter in 2-3 hours is still a lot of lifesaver. But on the other hand yes this might not be the correct solution. Maybe I should solve this specific problem of the system in our own way. |
|
I want to create my version of Doctrine Paginator but need to override the count query for better performance