Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logical data type
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00415925
Message ID:
00442188
Views:
10
>>>>>>>What data-type do you use if you need if you need an index on that field?
>>>>>>
>>>>>>I forget the reason, but you do not index bit fields in SQL Server.
>>>>>
>>>>>The same reason you don't in VFP. Bit fields have only two possible values. Indexing on this field will result in the query optimizier using too many rows when determing a final result set.
>>>>>
>>>>>Example:
>>>>>Say you have an even distribution of 1s and 0s. An intermediate result will be built with approximately half of the rows in your table. This result set would then have to be matched with the results sets from the other selection criteria. If you took out the bit index, then the final result would be processed to determine what rows matched the bit flag.
>>>>>
>>>>>Just my opinion.
>>>>
>>>>Does this also hold true with a bit field index with high selectivity? In other words, what happens with 1,000,000 records, and only 20 or 30 have a bit field = 1?
>>>
>>>In this case, if you are only ever going to query on the 1 side, then it may be beneficial.
>>
>>Interesting... The SQL Server 7 Index wizard does not allow me to create an index on a bit column.
>
>SQL Server 7 cannot have an index on a bit column.
>The slections on bit columns are allways very fast, but if you really need more speed then you will have to substitute the bit column by something else.

Thank you for clearing this up.
Chris McCandless
Red Sky Software
Previous
Reply
Map
View

Click here to load this message in the networking platform