Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 indexed views

Author  Topic 

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2005-04-18 : 15:39:15
Afternoon,

I have a table that has multiple columns, one column is a bit field that basically tells me if the record belongs in one Class or another.

So if its a 0 its this
and if its a 1 its that.

If I have a view to get at the data, should I put an index on that bit field? will that help?

________________________________________________

Bier is a privelege of the working man (or woman).

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2005-04-18 : 16:04:14
If you create an index only on a bit column SQL Server will never use the index because it is not selective enough. In order for the index to be useful try creating a multi column index instead.

Dustin Michaels
Go to Top of Page

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2005-04-18 : 16:25:11
thanks.

I have another column I want to index so that will work well.

I learned something new and its a monday.. breaking precedence.

________________________________________________

Bier is a privelege of the working man (or woman).
Go to Top of Page
   

- Advertisement -