Closed (fixed)
Project:
Job Posting
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2009 at 10:45 UTC
Updated:
6 Aug 2009 at 16:10 UTC
I've got following MySQL error when clicking on offers:
user warning: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay query: SELECT DISTINCT(n.nid), n.title FROM node n INNER JOIN job_posting p ON n.nid = p.nid INNER JOIN node_access na ON na.nid = n.nid LEFT JOIN node i18n ON n.tnid = i18n.tnid AND i18n.language = 'en' WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'job_view') OR (na.gid = 0 AND na.realm = 'user_relationship_node_access_author'))) AND ((n.moderate != 1)) AND (( CASE n.type WHEN 'stormnote' THEN 0 WHEN 'stormorganization' THEN 0 WHEN 'stormproject' THEN 0 WHEN 'stormtask' THEN 0 ELSE 1 END )=1 ) AND (n.language ='en' OR n.language ='' OR n.language IS NULL OR (n.language = 'pl' AND i18n.nid IS NULL)) AND ( n.status = 1 AND (p.deadline > 1232102504 OR p.expires = 0) )ORDER BY n.created DESC LIMIT 0, 6 in /home/sites/co.uk/public_html/sites/all/modules/contributions/job_posting/job_posting.module on line 912.
Comments
Comment #1
kenorb commentedWhat's the reason?
Comment #2
ainigma32 commentedIt means that the select needs to read more rows than is allowed. See here http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysv...
This is caused by the contributed modules adding to the query that is generated by the Job Posting module.
If you can't change the MySQL server config, maybe gmarus will have some idea how to fix this.
Good luck!
- Arie
Comment #3
kenorb commentedUnfortunately I can't change.
I've got "genius" account on HeartInternet and you can' change anything related to mysql, they saying that this is the problem of 3rd party, not them.
Talk to the hand.
Comment #4
ainigma32 commentedJust out of curiosity: how many records do you have in the tables that are being queried (i.e. node job_posting and node_access) ?
- Arie
Comment #5
kenorb commentedAround 3,637 in job_posting;)
1,398 total in node_access
I've found some FAQ on HeartInternet hosting provider:
I was thinking what's the best place to put this query?
The other issue is that I'm not always see this error, so I'll don't know if it will fix this problem:)
Comment #6
kenorb commentedI've put that in job_posting_list_nodes() function:
I think that it's ok.
It can be improved something like:
Comment #7
gmarus commentedI'm changing this to a support request because this is an issue with MySQL configuration and not a coding/logic error in the module. You're seeing this error because your host provider has set non-default values for both/either SQL_BIG_SELECTS and MAX_JOIN_SIZE -- at least that's my interpretation. But don't take my word for it. Here's a reference link so you can see for yourself (and possibly forward to your host provider for comment):
http://dev.mysql.com/doc/refman/5.0/en/server-session-variables.html#sys...
If they seem unwilling to fix it but you're otherwise happy with their services, your resort to the set option clause may be the simplest workaround.
Comment #8
kenorb commentedI'll try to find some general solution:
#361967: Increase MAX_JOIN_SIZE and MAX_ALLOWED_PACKET settings in system.install
Comment #9
kenorb commentedComment #10
kenorb commentedhttp://drupal.org/project/db_tweaks