SQL SERVER参数化查询后不走筛选索引
发布时间:2016-10-09 06:03:03 所属栏目:MsSql教程 来源:站长网
导读:DROP TABLE T_TESTCREATE TABLE T_TEST( ID INT IDENTITY PRIMARY KEY,STATUS BIT)INSERT INTO T_TEST SELECT 0GO 100000INSERT INTO T_TEST SELECT 1 CREATE INDEX IXF_T_TEST_STATUS ON T_TEST(STATUS) WHERE STATUS=1UPDATE STATISTICS T_TEST with ful
DROP TABLE T_TEST CREATE TABLE T_TEST( ID INT IDENTITY PRIMARY KEY,STATUS BIT ) INSERT INTO T_TEST SELECT 0 GO 100000 INSERT INTO T_TEST SELECT 1 CREATE INDEX IXF_T_TEST_STATUS ON T_TEST(STATUS) WHERE STATUS=1 UPDATE STATISTICS T_TEST with fullscan DBCC FREEPROCCACHE --正常查询 SELECT * FROM T_TEST WHERE STATUS=1
这让我情何以堪? 查看本栏目更多精彩内容:http://www.bianceng.cn/database/SQLServer/ (编辑:南京站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读