MySQL - SQL_BIG_SELECTS

前端 未结 6 1347
渐次进展
渐次进展 2020-11-27 17:50

Hey, I\'ve been investigating SQL_BIG_SELECTS, but the MySQL documentation so far has been pretty unhelpful. I\'m looking for some insight as to preventing errors like the o

6条回答
  •  孤城傲影
    2020-11-27 18:25

    As someone has post before, you can not set SQL_BIG_SELECTS on my.cnf at server startup. This kind of variable does not support that.

    I had a same problem with a Symfony application showing this annoying 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
    

    But you can increase the number of varialbe

    max_join_size which is related to sql_big_selects

    I was able to fix it executing a command as privileged mysql user:

    # SET GLOBAL max_join_size=18446744073709551615;
    

    Or you can include it in my.cnf because max_join_size is allowed to set up in configuration file

    Well, I hope this can help someone else.

提交回复
热议问题