Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting a PDOException
during a cron run.
SQLSTATE[42000]: Syntax error or access violation: 1104 Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET SQL_MAX_JOIN_SIZE=# verwenden
This this the German error message for an ER_TOO_BIG_SELECT
.
It comes from
$result = db_query("SELECT t.word AS realword, i.word FROM {search_total} t LEFT JOIN {search_index} i ON t.word = i.word WHERE i.word IS NULL", array(), array('target' => 'slave'));
Comment | File | Size | Author |
---|---|---|---|
#1 | 1189484-search-big-select.patch | 1.11 KB | Niklas Fiekas |
search-big-select-stacktrace.txt | 4.82 KB | Niklas Fiekas |
Comments
Comment #1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedThe attached (naive) patch solves the problem for me. I guess it it neither good style nor portable, however.
Comment #2
jhodgdonEnglish translation of this message from the MySQL site:
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
Comment #3
jhodgdonAppears to be related to this other issue #1365786: The OR query in SearchIndex::updateWordWeights() can exceed SQL select limits / PHP memory limit, change to an IN() -- same area of code anyway. Probably both of the queries need a LIMIT on them.
Comment #4
jhodgdonI just filed a meta-issue #2367253: [META] Several problems in search_update_totals() to clarify the similarities and differences between this issue and the others around search_update_totals(). I'm hoping we can fix them all together?
Comment #13
catchMarking this duplicate of #1365786: The OR query in SearchIndex::updateWordWeights() can exceed SQL select limits / PHP memory limit, change to an IN().