MySQL - SQL_BIG_SELECTS

前端 未结 6 1344
渐次进展
渐次进展 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:41

    1. MySQL determines whether or not a query is a 'big select' based on the value of 'max_join_size'. If the query is likely to have to examine more than this number of rows, it will consider it a 'big select'. Use 'show variables' to view the value of the max join size.

    2. I believe that indexing and particular a good where clause will prevent this problem from occuring.

    3. SQL_BIG_SELECTS is used to prevent users from accidentally executing excessively large queries. It is okay to set it to ON in mysql.cnf or using the command-line option at startup.

    4. You can set SQL_BIG_SELECTS in my.cnf or at server startup. It can also be set on a session basis with SET SESSION SQL_BIG_SELECTS=1.

    5. Not that I can think of. I would just check your query to make sure that you really need to use it. Our servers have it turned on by default, and max_join_size is very large.

提交回复
热议问题