私のクエリの結果セットは約 60,000 行です。
SELECT f.client_id,
f.SECTION_A,
Month(f.received_date) Month,
Count(*) Count
FROM MILLENNIUM_DW_DEV..F_ACCESSION_DAILY f
LEFT JOIN salesdwh..TestPractices t
ON F.CLIENT_ID = t.ClientID
WHERE t.ClientID IS NULL
AND Month(f.received_date) BETWEEN 1 AND 11
AND Year(f.received_date) = 2012
GROUP BY f.SECTION_A,
Month(f.received_date),
f.client_id
ただし、2 つの左結合を追加すると、56k 行に制限されます。
SELECT f.client_id,
f.SECTION_A,
Month(f.received_date) Month,
Count(*) Count,
s.SALES_REP_NAME,
s.REGION_NAME
FROM MILLENNIUM_DW_DEV..F_ACCESSION_DAILY f
LEFT JOIN salesdwh..TestPractices t
ON F.CLIENT_ID = t.ClientID
LEFT JOIN MILLENNIUM_DW_DEV..D_CLIENT d
ON d.CLIENT_ID = f.CLIENT_ID
LEFT JOIN MILLENNIUM_DW_DEV..D_SALES_HIERARCHY s
ON s.SUB_TERRITORY_NBR = d.SUB_TERRITORY_NBR
WHERE t.ClientID IS NULL
AND Month(f.received_date) BETWEEN 1 AND 11
AND Year(f.received_date) = 2012
AND d.REC_ACTIVE_FLG = 1
AND s.REC_ACTIVE_FLG = 1
GROUP BY f.SECTION_A,
Month(f.received_date),
f.client_id,
s.SALES_REP_NAME,
s.REGION_NAME
私の左結合が結果セットを LIMIT するのはなぜですか?