To me, joining 9 tables in a single statement is a lot! Pairwise may have been imprecise - I mean joining two tables then joining that result to another table, then that result to another table. Obviously they are ordered to the degree that the necessary key is available at each point.
이 나에게 명확하지 않다. 사실, 사실이 아닙니다. MOST SQL 플랫폼 (아직 사용중인 SQL 컴파일러가 없음)은 SQL 문을 컴파일하고 실행 계획을 구성합니다. 이 계획은 조인이 실행될 때 최적화되고 이동합니다. 병렬로 실행되는 많은 시스템에서 동시에 조인을 실행합니다.
명령문의 "순서"를 이해하는 방법은 실행 계획을 보는 것입니다.
많은 시스템에서 순서를 제어하는 방법은 CTE를 사용하는 것입니다. 이런 식으로 뭔가 :
WITH subsetofbigtable AS
(
SELECT *
FROM reallybigtable
WHERE date = '2014-01-01'
)
SELECT *
FROM subsetofbigtable
JOIN anothertable1 ...
JOIN anothertable2 ...
JOIN anothertable3 ...
JOIN anothertable4 ...
JOIN anothertable5 ...
또한 열팽창 계수가 "순서"조인하는 체인 수 있습니다
WITH subsetofbigtable AS
(
SELECT *
FROM reallybigtable
WHERE date = '2014-01-01'
), chain1 AS
(
SELECT *
FROM subsetofbigtable
JOIN anothertable1 ...
), chain2 AS
(
SELECT *
FROM chain1
JOIN anothertable2 ...
)
SELECT *
FROM chain2
JOIN anothertable3 ...
JOIN anothertable4 ...
JOIN anothertable5 ...
페어 조인에 의해 무슨 뜻 이죠. – Hogan
9 개의 테이블에 가입하는 것은 그리 많지 않습니다. – Hogan
"별난 공간 오류"란 무엇입니까? – Hogan