Jonathan Lahijani Posted February 24, 2022 Posted February 24, 2022 I'm having an extremely weird issue that I can't pinpoint in my code. When a particular $pages->find is done as a superuser, the search is quick. However if the user doesn't have the superuser role, it's very slow (over 15 seconds). There's no code in my codebase that would cause this. Any ideas would be appreciated.
Jonathan Lahijani Posted February 24, 2022 Author Posted February 24, 2022 Ack, well it had to do with 'check_access' not being set to zero in my selector. I don't think I've ever had to deal with that before. https://processwire.com/docs/selectors/#access_control
Robin S Posted February 24, 2022 Posted February 24, 2022 4 minutes ago, Jonathan Lahijani said: Ack, well it had to do with 'check_access' not being set to zero in my selector. Weird though, because the non-superuser should be dealing with fewer results so if anything I would expect it to be faster. I wonder if there's any relation to the weird slow query issues that @adrian has reported recently. https://github.com/processwire/processwire-issues/issues/1523https://github.com/processwire/processwire-issues/issues/1535
Jonathan Lahijani Posted February 24, 2022 Author Posted February 24, 2022 4 minutes ago, Robin S said: Weird though, because the non-superuser should be dealing with fewer results so if anything I would expect it to be faster. I wonder if there's any relation to the weird slow query issues that @adrian has reported recently. https://github.com/processwire/processwire-issues/issues/1523https://github.com/processwire/processwire-issues/issues/1535 Thanks for your response. In my case it was definitely the check_access option. To figure this out, I had to diff the MySQL queries as superuser vs. non-superuser and see where the bottleneck was and it had to do with calls to the pages_access table on a particular query.
adrian Posted February 24, 2022 Posted February 24, 2022 3 hours ago, Robin S said: I wonder if there's any relation to the weird slow query issues that @adrian has reported recently. The first one of those was basically due to index issues in my DB - running optimize on all tables fixed it, although I still found some significant improvements to speed that could be implemented. The second one is very weird - certainly seems like findMany seems some attention. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now