While executing JOIN SQL query in live server, i got the following error. [code] The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay: [/code] To resolve this error, I have used the following SQL query before executing the JOIN SQL query. …
Tag: Mysql Optimization
Permanent link to this article: https://blog.openshell.in/2013/08/mysql-error-sql_big_selects/
Dec 29
MySQL Subquery Optimization
Never use a subquery inside a WHERE field IN(…) the SQL query. It will slow down the process. Slow: SELECT * FORM table1 WHERE field1 IN (SELECT field2 FROM table2 GROUP BY field1) Instead of using a subquery inside an IN(…), use INNER JOIN query. It will speed up the process, but in IN(…) query …
Permanent link to this article: https://blog.openshell.in/2010/12/mysql-subquery-optimization/