日期:2014-05-17  浏览次数:20423 次

清楚sqlserver2005清楚日志问题
1、sqlserver2005 清除日志文件以后,释放出来的空间是释放给操作系统,还是数据库保留着释放的空间。

2、一般都建议查询时尽量不使用is null 或者null
那比如 select cola from ta_a where cola is null 能优化嘛 
cola是int 情况
cola是nvarchar() 情况呢
……

------解决方案--------------------
释放的空间还给磁盘
------解决方案--------------------
SQL code
1、释放的空间还给了磁盘 
2、 select cola from ta_a where cola is null 会全表扫描,不管字段类型是什么类型都是,可以在定义字段时设置默认值,然后用默认值来替换 IS NULL的查询。不过 如果字段上有索引,可以加强制索引来查询即 select cola from ta_a with(index(index_name)) where cola is null