_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › FilteredIndexesAndStatistics

Contents

1 Filtered Index
2 Example
3 谿瑚襭


1 Filtered Index #

磯 碁煙る 譟郁唄襯 企 朱 碁煙燕. れ螻 螳 レ .

  • レ焔 貎朱Μ 焔 覦 螻 讌
  • 譴企 碁煙 讌 蟯襴 觜
  • 譴企 碁煙 レ 觜

2 Example #

use tempdb
go

--drop table test
create table test(gender nchar(1));

with temp(num)
as
(
        select 1 num
        union all
        select num + 1 from temp
        where num + 1 <= 10
)
insert test(gender) 
select N'' -- 1000蟇
from temp a, temp b, temp c
union all
select N'' -- 10蟇
from temp;

create nonclustered index filtered_nix
on test(gender)
where gender = N'';

--full scan 襴
select * from test where gender = N'' --れ襦 Full Scan.

--index seek 襴
select * from test where gender = N'' --れ襦 Index Seek.

蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

伎 豢. (豺誤)