Database Error (DB Error)

We have a problem under editors role as we click the archives, we get the following message

    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

The hosting service says, “the reason you see this error is because your query is (apparently) too big. Unfortunately, we cannot change this setting because it helps to protect our servers against queries which will take too much server power.”

I need help please.

Hi @anupent,

See e.g. http://forum.pkp.sfu.ca/t/error-in-stats-reports-page; also, what version of OJS are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you Asmecher for your reply, But I am unable to do anything helpful to me. Stack trace shows the following SELECT

classes/submission/editor/EditorSubmissionDAO.inc.php line 356
Function: DAO->retrieveRange(“SELECT DISTINCT a.*, scf.date_completed as copyedit_comp…”, Array(21), Object(DBResultRange))

I have hardly 10 articles in one issues so far. I am adding them for back issue and continuing in a hope there will be some solution soon.

I am using the latest version i.e. 2.4.8

Regards
anupent

Hi @anupent,

Could you try the proposed change from the other thread?

Please report back if you’re able to get this working.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher, for your reply

Please don’t laugh at my naivety,
From what i find during compring the codes in my files ‘JournalStatisticsDAO.inc.php’, those changes have already been committed. I think the changes were made during updating the OJS.

If I am wrong, please let me know where.
If i am not wrong, what options do i have now?

Regards
@anupent

Hi @anupent,

No, you’re correct – that change was included in OJS 2.4.8.

I’m not sure why such a small installation would be encountering this problem. Could you send me a private message with details to access a database dump? Also, could you check the size of the MAX_JOIN_SIZE setting in your MySQL configuration?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,
Please check your inbox.

Regards
@anupent

Hi @anupent,

I installed your database and set the row limit down to 4000000 in the my.cnf configuration file and was able to replicate the problem.

Reviewing your database, there is nothing unusual there and it is quite a small data set. There are OJS users running the same version with orders of magnitude more content on unremarkable servers.

The query in question is a complex one and I’m sure that there are improvements that could be made, but nothing jumped out at me as the cause of a combinatorial explosion. And I’m confident we would have seen this in practical cases with larger clients if it were an obvious problem.

I suspect that the MySQL configuration limit for MAX_JOIN_SIZE is simply too low for an application that’s running joins of this complexity. Unfortunately my best recommendation is to find another host if they’re unwilling to increase the limit.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher.

Changing the host seems only the feasible solution. Can you suggest me what
should be the minimum database row limit to run OJS without this problem?

Regards
anupent

Hi @anupent,

I don’t have a specific recommendation to suggest – but the default (as per my machine and elsewhere) seems to be 18446744073709551615, which is massively bigger than the 4000000 your current host has set. Anecdotally we have only heard very rarely about limits like yours being imposed (as per these two linked threads).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Ultimately decided to shift to a new host with MAX_JOIN_SIZE = 18446744073709551615.

Hope I will not have problem then.

Will write to you with the results once the transfer process is complete.

Regards
@anupent

See this open issue on this topic:

Hello @asmecher,
We have changed the server and the problem is solved.

Thank you for your time and effort in all this.

Regards
@anupent

We have a similar problem in the backend, in the “submissions under review” section.

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 have emailed the provider (hosteurope), they won’t change the SELECT value because they say they do not change third party skripts.

Is there a workaround? Will it help if I do an update or delete something via FTP?
This is the first time this error has occurred to my knowledge.
We are using OJS Version 2.4.8.1
Best regards
Sören, Future of Food Journal

Hi @fofj_org,

I have no idea but I believe upgrading or deleting something via FTP would not help.
If you have tried the above given advises by @asmecher, then I hope increasing the SELECT value may be the only solution.

Our problem was solved after we changed our hosting company.

Regards,

Hi @anupent ,

I know this has been a while. I am having the same problem here. May I ask which hosting service you are using, which provides a higher Max size? Thank you.

Paul

Hi @Paul_Chen, lets hear from Alec before taking that decision. Tagging @asmecher here.

@anupent

Hi @anupent,

I solved issue. [Resolved]Locale (en_US) not loaded during upgrade to 2.4.8 - #29 by Paul_Chen

So I don’t need to move to another hosting service for now. Thank you.

Paul

1 Like

Glad, you solved it.

Dear @anupent - thank you very much for this information, I guess I will have to try out things like updating before switching to another provider.