2014-04-30 82 views
4

MariaDB 10中的表連接數限制爲61 as is the case for MySQL還是另一個數?MariaDB中表連接的最大數量是多少?

(我找不到在MariaDB documentation或通過google搜索的答案)。

+0

爲什麼會這麼重要?您不太可能需要正確規範化的模式中的JOIN數量。 – Strawberry

+0

取決於複雜性。我以前的(700萬英鎊)項目大規模地解決了這個問題,不得不使用很多解決方法。 –

+0

該查詢是否已完成運行? – Strawberry

回答

4

MariaDB的具有在連接的61代表相同的最大數目。

這個查詢

CREATE TABLE t (i INT(10) NOT NULL); 
select * 
from t a01 join t a02 join t a03 join t a04 join t a05 join t a06 join t a07 join t a08 join t a09 join t a10 
join t a11 join t a12 join t a13 join t a14 join t a15 join t a16 join t a17 join t a18 join t a19 join t a20 
join t a21 join t a22 join t a23 join t a24 join t a25 join t a26 join t a27 join t a28 join t a29 join t a30 
join t a31 join t a32 join t a33 join t a34 join t a35 join t a36 join t a37 join t a38 join t a39 join t a40 
join t a41 join t a42 join t a43 join t a44 join t a45 join t a46 join t a47 join t a48 join t a49 join t a50 
join t a51 join t a52 join t a53 join t a54 join t a55 join t a56 join t a57 join t a58 join t a59 join t a60 
join t a61 join t a62; 

產生ERROR 1116 (HY000): Too many tables; MariaDB can only use 61 tables in a join

+0

很好的答案,謝謝你測試這個。出於興趣(和後代),您使用的是MariaDB的哪個版本? –

+0

我在使用MariaDB 10.0.11。 –

相關問題