OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



DB Error: The SELECT would examine (...)

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: DB Error: The SELECT would examine (...)

Postby CarlaTC » Sun Mar 14, 2010 4:29 pm

Hello

I'm reading all the solutions written here, but I'm using the OJS 2.3.1.2 version and, although I have tried the solutions mentioned in this topic, I still can display the list of currently submissions from the "editor" section.

The error message is the same:

DB Error: 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

The strange thing is that this occurred after uploaded and published over 100 paper, because of a platform migration.

Is there a way to fix this error in this version of OJS?

Thanks

Carla Tossi
Layour Editor
Economic Analysis Review (RAE-EAR)
CarlaTC
 
Posts: 1
Joined: Sun Mar 14, 2010 4:10 pm

Re: DB Error: The SELECT would examine (...)

Postby erreal » Mon Nov 05, 2012 2:51 am

Hello everyone,

I have the same problem: "DB Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay".

I put de debug ON and this is what I gett:

(mysql): SELECT * FROM sessions WHERE session_id = '18b39ff35d9f2a2214719f62ad209a27'
(mysql): SELECT * FROM users WHERE user_id = 1
(mysql): SELECT * FROM user_settings WHERE user_id = '1'
(mysql): select version()
(mysql): SELECT * FROM journals WHERE path = 'ENE'
(mysql): SELECT * FROM site
(mysql): SELECT v.* FROM versions v LEFT JOIN plugin_settings ps ON lower(v.product_class_name) = ps.plugin_name AND ps.setting_name = 'enabled' AND ((journal_id = '2') OR v.sitewide = 1) WHERE v.current = 1 AND (ps.setting_value = '1' OR v.lazy_load <> 1)
(mysql): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = 'timedviewplugin' AND journal_id = '2'
(mysql): SELECT * FROM roles WHERE user_id = 1 ORDER BY journal_id
(mysql): SELECT * FROM notifications WHERE user_id = 1 AND level = 1 ORDER BY date_created DESC
(mysql): SELECT i.* FROM issues i WHERE journal_id = '2' AND current = 1
(mysql): SELECT * FROM issue_settings WHERE issue_id = '2'
(mysql): SELECT * FROM roles WHERE user_id = 1 AND journal_id = 2 ORDER BY journal_id
(mysql): SELECT iss.subscription_id FROM institutional_subscriptions iss, subscriptions s, subscription_types st WHERE POSITION(UPPER(LPAD(iss.domain, LENGTH(iss.domain)+1, '.')) IN UPPER(LPAD('84.79.229.209', LENGTH('84.79.229.209')+1, '.'))) != 0 AND iss.domain != '' AND iss.subscription_id = s.subscription_id AND s.journal_id = '2' AND s.status = 1 AND s.type_id = st.type_id AND st.institutional = 1 AND ((st.non_expiring = 1) OR (st.non_expiring = 0 AND ('2012-11-05 10:46:55' >= s.date_start AND '2012-11-05 10:46:55' <= s.date_end))) AND (st.format = 1 OR st.format = 17)
(mysql): SELECT isip.subscription_id FROM institutional_subscription_ip isip, subscriptions s, subscription_types st WHERE ((isip.ip_end IS NOT NULL AND '1414522321' >= isip.ip_start AND '1414522321' <= isip.ip_end AND isip.subscription_id = s.subscription_id AND s.journal_id = '2' AND s.status = 1 AND s.type_id = st.type_id AND st.institutional = 1 AND ((st.non_expiring = 1) OR (st.non_expiring = 0 AND ('2012-11-05 10:46:55' >= s.date_start AND '2012-11-05 10:46:55' <= s.date_end))) AND (st.format = 1 OR st.format = 17)) OR (isip.ip_end IS NULL AND '1414522321' = isip.ip_start AND isip.subscription_id = s.subscription_id AND s.journal_id = '2' AND s.status = 1 AND s.type_id = st.type_id AND st.institutional = 1 AND ((st.non_expiring = 1) OR (st.non_expiring = 0 AND ('2012-11-05 10:46:55' >= s.date_start AND '2012-11-05 10:46:55' <= s.date_end))) AND (st.format = 1 OR st.format = 17)))
(mysql): SELECT i.* FROM issues i WHERE journal_id = '2' AND current = 1
(mysql): SELECT * FROM issue_settings WHERE issue_id = '2'
(mysql): SELECT count(*) FROM notifications WHERE user_id = 1 AND date_read IS NULL AND level = 2 AND context_id = 2


I tried to follow the instructions here, but i can't find the DBConnection.inc.php, there is no db folder in classes. I tried with the search but I can't find anything. Would you help me?


Thanks (and sorry for my english).
erreal
 
Posts: 3
Joined: Wed Oct 31, 2012 4:00 am

Re: DB Error: The SELECT would examine (...)

Postby springday » Mon Nov 05, 2012 9:24 am

Hi erreal,

the "db" folder is not in /classes, but in /lib/pkp/classes. You'll find the DBConnection.inc.php there.

(I've been confused a lot by this and wondered why there are two separate /classes folders. It makes finding source code files more difficult. However, I believe the PKP team can manage the code base more easily this way: /classes is the individual source code of OJS, /lib/pkp/classes is the source code that all PKP applications - OJS, OCS, OMP - share with eath other)

Best regards,
Kai Weber
springday
 
Posts: 111
Joined: Wed Jul 25, 2012 2:56 pm
Location: Munich, Germany

Re: DB Error: The SELECT would examine (...)

Postby profps » Wed Mar 12, 2014 1:35 pm

stephanehess wrote:Alec,

thanks. This worked, but with

Code: Select all
$this->dbconn->Execute("SET OPTION SQL_BIG_SELECTS=1");


instead of

Code: Select all
$this->Execute("SET OPTION SQL_BIG_SELECTS=1");


Best wishes

Stephane


Alec,
This solution is five years old... Is it still the same solution for OJS latest release?


Regards,
Paul
profps
 
Posts: 14
Joined: Mon Oct 24, 2011 4:22 am

Re: DB Error: The SELECT would examine (...)

Postby asmecher » Wed Mar 12, 2014 2:12 pm

Hi Paul,

The best solutution is to edit your MySQL configuration. This work-around is appropriate for users who can't do that. The problem is not a bug in OJS -- it's a requirement for the way MySQL is configured to make it play nicely with OJS, depending on how big your database is.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB Error: The SELECT would examine (...)

Postby profps » Wed Mar 12, 2014 3:49 pm

Thanks Alec.

Much appreciated,

Paul
profps
 
Posts: 14
Joined: Mon Oct 24, 2011 4:22 am

Re: DB Error: The SELECT would examine (...)

Postby profps » Wed Mar 12, 2014 5:23 pm

How do I go about editing MySQL configuration to work well with OJS? Is there any step by step guidance on this in the document or anywhere? Because when the process below was performed the website went down (it’s been restored back up now):

I created a backup of the file public_html/lib/pkp/classes/db/DBConnection.inc.php named DBConnection.bak and then I added:

$this->dbconn->Execute("SET OPTION SQL_BIG_SELECTS=1");

to line 75 right before:

return $this->initConn();
profps
 
Posts: 14
Joined: Mon Oct 24, 2011 4:22 am

Re: DB Error: The SELECT would examine (...)

Postby asmecher » Thu Mar 13, 2014 9:33 am

Hi Paul,

See e.g. http://stackoverflow.com/questions/950465/mysql-sql-big-selects.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB Error: The SELECT would examine (...)

Postby profps » Fri Mar 14, 2014 8:35 pm

There seems to be no solution coming either from here or there for anyone using shared hosting! :roll:
profps
 
Posts: 14
Joined: Mon Oct 24, 2011 4:22 am

Re: DB Error: The SELECT would examine (...)

Postby asmecher » Tue Mar 18, 2014 9:32 am

Hi Paul,

Have you tried the modification exactly as described in the thread you quoted? The two relevant posts are this one, describing the location for the modification, and this subsequent one, correcting it slightly.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB Error: The SELECT would examine (...)

Postby birkok » Fri Mar 21, 2014 3:29 am

This is very urgent please help.

I have upgraded to v.2.4.3 and applied the above treatment, but it gives completely blank page.

bluehost server company does not allow change "my.cnf file "
They want to sell new hosting. They send me the message: "you may need to upgrade to a VPS or dedicated account".
Do you think is it mysql db limitation?

How can i solve following error:

DB Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay

Thanks in advance
birkok
 
Posts: 80
Joined: Sat Sep 22, 2007 5:12 am

Re: DB Error: The SELECT would examine (...)

Postby asmecher » Fri Mar 21, 2014 8:03 am

Hi birkok,

Can you specifically describe the modification you've made?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB Error: The SELECT would examine (...)

Postby birkok » Sat Mar 22, 2014 2:07 am

Thank you Alec for your reply..
The problem is solved..
It was because of not properly updated SQL DB while upgrading OJS.

I have compared dbs and saw that the old db has 117 tables and new upgraded db has 115 tables. Then I used the old one and problem solved.

So the cause of this error is that not properly update the database..

Regards
birkok
 
Posts: 80
Joined: Sat Sep 22, 2007 5:12 am

Re: DB Error: The SELECT would examine (...)

Postby asmecher » Sat Mar 22, 2014 8:07 am

Hi birkok,

If you're using a database that hasn't been upgraded using the upgrade script, you're certain to run into trouble.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Previous

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 4 guests

cron