_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › StarJoin
|
|
[edit]
1 蠍磯蓋 螳 #Star Join 一危 危一れ Start Schema 貎朱Μ 譯 煙ロ 伎企. Star Join Join 襯 譴企 蟆 覈企. 谿螻 企 一危一 襷れ 谿企ゼ 覲伎碁. 谿 覈 覦炎唄碁 觜 碁 覈 豌襷 蟇, 覈 糾唄 蠍磯蓋企. 蠏碁 谿螻 瑚 螻伎 Join蟆 覃 I/O 觜覲企 Join 觜 貉れ蟆 . 讀, 谿1, 谿2, 谿3, 企 企朱 朱 一危 郁屋 蠍磯朱 れ螻 螳 豌襴 蟆企.
Start Join る語壱危 ろる 蟯 . 襷 DBMS螳 Star Join 讌讌 る る語壱危 ろる 讌 焔レ 伎蟆 . 蠏碁覩襦 る語壱危 ろる襯 企 覦 蟲豢 DBMS Star Join 讌 覿襯 誤 覲伎 . 螳 蟆 讌 ろ 企慨.
[edit]
3 Star Join ろ #朱 谿 企 覈 Cross Join .
select * into #temp from dbo.Dim_TestCode1 cross join dbo.Dim_TestCode2 cross join dbo.Dim_TestCode3 cross join dbo.Dim_TestCode4 cross join dbo.Dim_TestCode5 れ 2螳 貎朱Μ 觜 豸′ 覲碁.
--1 select a.CodeNM1 , a.CodeNM2 , a.CodeNM3 , a.CodeNM4 , a.CodeNM5 , sum(b.Cnt*1.0) from #temp a inner join dbo.Fact_Test b on a.CodeKey1 = b.CodeKey1 and a.CodeKey2 = b.CodeKey2 and a.CodeKey3 = b.CodeKey3 and a.CodeKey4 = b.CodeKey4 and a.CodeKey5 = b.CodeKey5 group by a.CodeNM1 , a.CodeNM2 , a.CodeNM3 , a.CodeNM4 , a.CodeNM5 order by 1,2,3,4,5 --2 select b.CodeNM1 , c.CodeNM2 , d.CodeNM3 , e.CodeNM4 , f.CodeNM5 , sum(a.Cnt*1.0) from dbo.Fact_Test a inner join dbo.Dim_TestCode1 b on a.CodeKey1 = b.CodeKey1 inner join dbo.Dim_TestCode2 c on a.CodeKey2 = c.CodeKey2 inner join dbo.Dim_TestCode3 d on a.CodeKey3 = d.CodeKey3 inner join dbo.Dim_TestCode4 e on a.CodeKey4 = e.CodeKey4 inner join dbo.Dim_TestCode5 f on a.CodeKey5 = f.CodeKey5 group by b.CodeNM1 , c.CodeNM2 , d.CodeNM3 , e.CodeNM4 , f.CodeNM5 order by 1,2,3,4,5 れ ろ螻 覲伎企 螳 貎朱Μ 觜谿願 覦. 豌 豌襴螳 襷 谿企. 豌 覯讌 貎朱Μ 蟆曙 5豐 豌襴螳 覈朱 覯讌 貎朱Μ 20豐螳 . ろ碁 2005覯 蟆伎襷 蠍磯蓋 螳 ろ語企襦 朱 Star Join 螳企手 螳覃 . SQL Server Star Join れ 瑚.
[edit]
4 SQL Server Star Join #2005 Star Join覲企 2008 Star Join 螳. SQL Server Star Join "Bitmap Filtering 伎 貎朱Μ 螻 豕"企. Bitmap Filtering 螳 れ螻 螳.
Bitmap Filtering
Optimized Bitmap Filtering
[edit]
5 2005 vs 2008 #2005覯 Table Scan 一一 煙 覲企 企 覦 譟郁唄螳 .
2008 豕 觜碁У 一一螳 讓 谿 企 碁Μ 朱 Table Scan 一一 煙 覲企 企 碁Μ (觜碁У 蟆)螳 企 碁Μ 讌 豌 覯讌 譟一 伎 企 覦 .
豕 觜碁У 蟲(襷 伎)
[edit]
6 SQL Server 2008 れ ろ #れ襦 PC ろ碁ゼ 企慨. 蟆郁骸 るる暑. 豕 Bitmap Filtering 覿蟲螻 れ襦 谿企ゼ 覲伎伎 . ろ Star Join 螳襦 蟆曙一 豌 豌襴 螳 レ . 豌襴 豌 覯讌 貎朱Μ螳 5豐願, 覯讌 貎朱Μ 20豐. 2005 觜 2008 Star Join 焔レ レり . れ ろ螻 觜 譴讌襷 れ襦 覲襦 焔レ レ蟇 螳讌 . 覦 覘 <; 譬 ろ碁ゼ 企 .
れ 豕 觜碁У 磯 蟆 誤 蟆企.
[edit]
7 SSIS 譟壱(Lookup)覲 #觜訣 覦覯朱 SSIS 譟壱覲 . 豌 覲伎 蠏碁殊 螳企一 企(Fact_Test) 觜り 螳企慨.
螳 Flat(1豌 襷 蟇) 螳讌螻 朱, Flat 殊 一危磯ゼ 企 曙伎 り 螳企慨.
企 一危磯ゼ j鍵 覦覯 螳讌讌襷 SQL 伎 kる れ螻 螳 SQL 燕伎 蟆企.
INSERT dbo.Fact_Test SELECT b.CodeKey1 , c.CodeKey2 , d.CodeKey3 , e.CodeKey4 , f.CodeKey5 , [0] FROM OPENROWSET( 'MSDASQL' , 'Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=C:\Documents and Settings\dwa2007\覦覃;' , 'select * from 豌襷蟇.txt') a inner join Dim_TestCode1 b on a.貊= b.CodeNM1 inner join Dim_TestCode2 c on a.貊= c.CodeNM2 inner join Dim_TestCode3 d on a.貊= d.CodeNM3 inner join Dim_TestCode4 e on a.貊= e.CodeNM4 inner join Dim_TestCode5 f on a.貊= f.CodeNM5 るジ 覦覯朱 SSIS 譟壱 覲 伎 一危磯ゼ 曙 蟆企.
覦覯 觜蟲 焔 觜蟲螳 .
* 蟯螻襯 朱 貉る螳 蟆. 觜襯願 襦り 蠎 SSIS襯 伎 蟆 譬る 蟆 . 讌覲伎 觜螻 襦 伎 伎 螳 蠍 覓語 磯殊 螳覦 觜 殊 .
鏤
|
讌襦 企 螳 覿覈 覈 手鬼企. (覈渚) |