摘要:
前言我看过不少对Bit字段能否建立索引,以及建立索引后性能如何的讨论,还有朋友建议用Tinyint代替Bit,我在这里深入研究一下:研究方法:一、建立六张表,具体说明见SQL语句中的注释部分:建表Sql语句Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->CREATEDATABASEIndexTestGOUSEIndexTestGO--bit无索引,0、1相等CREATETABLEdbo.TestBitNoIndex(TestIDINTNOTN 阅读全文
摘要:
Now, the question is, do you really WANT an index on a BIT column? We're going to run some experiments, but in general, it is highly unlikely that you will get much use out of such an index. The exception is when the data is heavily weighted towards, say, 1 (e.g. 95-99% of the table), and you ar 阅读全文
摘要:
SELECT TOP 100 [Total Cost] = ROUND(avg_total_user_cost * avg_user_impact * ( user_seeks + user_scans ), 0) , user_seeks , user_scans , avg_total_user_cost , avg_user_impact , TableName = statement , [EqualityUsage] = equality_columns , [InequalityUsage] = inequality_columns , [Include Cloumns] = .. 阅读全文