The SELECT would examine more than MAX_JOIN_SIZE rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Debianer
    New Member
    • Mar 2005
    • 11
    • 3.6.x

    The SELECT would examine more than MAX_JOIN_SIZE rows

    Hey everybody,
    I get every hour this error mail:
    Invalid SQL:

    SELECT pmtext.pmtextid
    FROM pmtext AS pmtext
    LEFT JOIN pm AS pm USING(pmtextid)
    WHERE pm.pmid IS NULL;

    MySQL-Fehler : 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
    Fehler-Nr. : 1104
    Fehler-Zeit : Monday, 21.07.2009 @ 12:21:32
    The size of max_join_size on the server:
    max_join_size 201326592
    It is a hosted package and I cannot increase the size.

    Are there any alternatives? What can I do?

    Thanks for your help.
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    If your host won't change those settings then there isn't anything else you can do. You would have to change hosts.

    Comment

    • Debianer
      New Member
      • Mar 2005
      • 11
      • 3.6.x

      #3
      Thank you for your answer.
      I have found out that SQL_BIG_SELECTS is OFF.

      Where I can add SQL_BIG_SELECTS=1?
      Would that help?

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        I don't know of any way to set that in vBulletin. AFAIK it needs to be set on the server.

        Comment

        • Debianer
          New Member
          • Mar 2005
          • 11
          • 3.6.x

          #5
          If I try this in in phpMyAdmin it seems to work:
          Code:
          SET SQL_BIG_SELECTS=1
          
          SELECT pmtext.pmtextid
          FROM pmtext AS pmtext
          LEFT JOIN pm AS pm USING(pmtextid)
          WHERE pm.pmid IS NULL;
          Maybe I can set it at the DB connection part in vB?

          Comment

          • Debianer
            New Member
            • Mar 2005
            • 11
            • 3.6.x

            #6
            My solution at the moment:
            I have added this in cleanup2.php:
            Code:
            $vbulletin->db->query_write("
                SET SQL_BIG_SELECTS=1"
            );
            Before:
            Code:
            $pmtexts = $vbulletin->db->query_read("
                SELECT pmtext.pmtextid
                FROM " . TABLE_PREFIX . "pmtext AS pmtext
                LEFT JOIN " . TABLE_PREFIX . "pm AS pm USING(pmtextid)
                WHERE pm.pmid IS NULL
            ");
            It works but is that okay or could it be a problem?
            Would it be better to add it generally e.g. in class_core.php at the connection part?

            Thank you.

            Edit:
            The Query runs for 50 minutes and I think it would be better to run the Query not every hour but once every night.
            Does this work without problems? Every hour is too often I think.
            Last edited by Debianer; Wed 22 Jul '09, 11:31am.

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...