为什么动态创建的索引没起作用?

y97523 2001-11-09 10:34:08
sql server200中
下面的过程
---delete index---
if exists (select * from dbo.sysindexes where name = N'IX_b' and id = object_id(N'[dbo].[table1]'))
drop index [dbo].[table1].[IX_b]
GO
-----------------has index query----------------------
select * from table1 where b='c'
go
---create index-----
CREATE INDEX [IX_b] ON [dbo].[table1]([b]) ON [PRIMARY]
GO
--------------------no index query----------------------
select * from table1 where b='c'
go
------------------------------------------

在sql查询分析器中分析发现两次有索引与无索引所花费的时间百分比是一样的!
这是怎么回事?
...全文
74 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
gmc007 2001-11-11
  • 打赏
  • 举报
回复
GZGZ
y97523 2001-11-11
  • 打赏
  • 举报
回复
upup
foolishchao 2001-11-10
  • 打赏
  • 举报
回复
MS sql server2000中,指定索引
-----------------has index query----------------------
select * from table1 with (index(IX_b)) where b='c'
KingSunSha 2001-11-09
  • 打赏
  • 举报
回复
有多少记录?

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧