MAX_JOIN_SIZE Error in debug.log

#416591
  • Resolved Anonymous
    Rank Math free

    MAX_JOIN_SIZE Error in debug.log
    rankmath\seo-by-rank-math-pro\includes\modules\analytics\class-pageviews.php
    public static function get_pageviews_with_object
    query exceeding 7 million row MAX_JOIN_SIZE on a small dataset.

    From my testing, a small change in the query will solve the problem. Instead of:

    Diff left join (sum t1 where A) left join (sum t2 where B)) where C

    change this to

    Diff left join (sum(t1 left join t2)) where A and B and C

    resultset is the same.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    Allow me to share this one with our development team. We should get back to you shortly with an update or advice.

    Looking forward to helping you.

    Hello,

    In the latest version of the PRO plugin, we don’t have that query in the function you mentioned.

    Could you please share a screenshot of the same so we can compare it with our very own source code?

    Looking forward to hearing back from you.

    Anonymous
    Rank Math free

    The query is from the latest rm pro. Your security prevented me from uploading SQL. Instead I wrote an abstract version of the query and the fix. Ive been writing sql for 20+ years. Query starts

    SELECT SQL_CALC_FOUND_ROWS o.*, COALESCE( traffic.pageviews

    it is the only query in function get_pageviews_with_object

    Anonymous
    Rank Math free

    I have two files (php snipets) showing the problem function and a suggested fix but i cant see how to attach them to the ticket.

    I tried to send the code plaintext 2 different ways but your security blocked me.

    Anonymous
    Rank Math free

    Or maybe this if nulls are an issue

    https://tinypix.top/i/query-new3.K1yD5

    Hello,

    Thank you for providing further clarity into the situation.

    We are going to add these as potential improvements to our repository so that our dev team can evaluate them and compare the results.

    If we find a performance gain and no functionality of the plugin is affected we might include the changes in a future update.

    Don’t hesitate to get in touch if you have any other questions or feedback.

    Anonymous
    Rank Math free

    Unfortunately this does not resolve the MAX_JOIN_SIZE problem.

    My suggestion was simply to show the problem can be solved. It is up to rank math to decide how to solve it.

    What do you recommend?

    Hello,

    We already added this to the repository for evaluation from the dev team.

    Until then you can try to resolve the issue by applying the changes you suggested manually.

    Don’t hesitate to get in touch if you have any other questions.

    Anonymous
    Rank Math free

    I would be happy to apply the change except I don’t know the syntax for the date range in the query.

    What i supplied was simply a guess. Can any developer look at the code and check the date range syntax is correct? The actual query I can confirm but there are 2 date ranges with 4 dates Im not able to confirm the syntax.

    I am a sql expert but not a php expert.

    Hello,

    I checked the query you created and the PHP syntax shouldn’t cause any issue as you are just passing arguments with the dates in it to construct and complete the query.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    We released a quick Beta update which includes improvements to the Analytics pageviews query. You can try to see if that helps.

    Please enable the Beta update by following this:
    https://rankmath.com/kb/version-control/#beta-updates

    beta update

    If you are unable to see an update, please clear Rank Math’s transients from:
    WP Dashboard > Rank Math > Status & Tools > Database Tools > Remove Rank Math Transients > Remove transients
    remove transients rank math

    Please clear the caches, server, and WordPress after updating.

    You can disable the Beta updates once you update to the latest version and if the issue is fixed.

    We are here to assist. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)

The ticket ‘MAX_JOIN_SIZE Error in debug.log’ is closed to new replies.