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
背景
項目做數據遷移,將老數據庫的部分數據通過中間表導入新庫中,發生報錯:
Error Code: 1104. 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
資料調查
1. MySQL官網解釋:超鏈接
2. 懷疑join_size不夠,查看最大join_size
SELECT @@max_join_size,@@globla.max_join_size,@@local.max_join_size;
解決辦法
1. 如果max_join_size不夠大,可以手動設置大一些。
set @@local.max_join_size=18446744073709551615, @@global.max_join_size=18446744073709551615;
然后再select查詢下max_join_size參數信息。