Jump to content

$pages->find is fast when superuser, slow when not


Jonathan Lahijani
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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/1523
https://github.com/processwire/processwire-issues/issues/1535 

Link to comment
Share on other sites

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/1523
https://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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...