Search is very slow for certain roles

jp flag

I'm a bit lost here. I have a strange problem and don't know where to begin. I use the core search function on a website I build. When I am logged in as administrator this search function is working and is very fast. When I log in as one of the users (with other role and permissions) the search function is very slow and sometimes even ending up in a 504 page.

I can't think of a good starting point to find out what the problem is. Who can help me think of a good debugging path?

id flag
It is possibly access checking. What sort of database is it and how is it set up?
Alfred Armstrong avatar
cn flag
As @cilefen said access checking is the most likely cause. I would guess that a module hook is altering the query to add access checking for non-admin users and this is not-performant for some reason.
Joost avatar
jp flag
Hhmm I am using the permissions by term module. This could be the problem. I’ll have a look. Thanks
id flag

The answer to your question about how to debug: you have to use a technique called “profiling”. By far the easiest PHP profiler to use is I’ve used it and I recommend it. Xdebug can profile too but by there is a lot to understand to use it

id flag
I have answered this question "Who can help me think of a good debugging path?" here.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.