In the function location_user() (implementation of hook_user?) takes forever to execute, and sometimes times out my website. It tries to do hundreds of sql queries.
The funny thing is I don't even use locations for users. Only for nodes.
If I comment out the switch case 'load' my site works fine again.
Can you please put a way to turn off this user functionality completely?
I believe because I am user_loading a bunch of users for other purposes on some pages (in a node access module) - and location is adding extra queries FOR EACH USER that don't do anything for me.
Comments
Comment #1
JoaoJose commentedI believe I've came across this problem also.
What's happening is that function "location_load_locations" is loading all node location instances when you're not logged in (uid=0), causing the server to max out.
The trigger is the default value for the uid field on the location_instance table being 0 by which then you get a match if you are not logged in (uid=0).
Here is the change I made to location.module:
//line 1078 after "function location_load_locations($id, $key = 'vid') {"
//add
if ($key == 'uid' && $id == 0) {
return $locations;
}
Worked for me :-)
Comment #2
danielb commentedOK some further testing has revealed that the max exec was not caused soley by the location queries themselves, but by massive db_rewrites being done on those queries in another module - the developer of that module has since improved these.
I'm leaving this here because of JoaoJose's reponse and so bdragon can see this and decide if anything needs to be investigated further or not.
Comment #3
bdragon commentedI changed the loading code to return an empty set of locations when it gets called with an empty $id parameter.
http://drupal.org/cvs?commit=153838
http://drupal.org/cvs?commit=153841
Comment #5
bdragon commentedBumping just because people are still hitting this one.
#343399: Location module cause "log in" process significantly slower marked duplicate.
Comment #7
Anonymous (not verified) commentedWhen used in conjunction with the Gmap module,
continues to increase in the process of apache.