Hello
You don't seem to be able to index a bit field in a table. I can sort of understand this as there are only 2 values to index. However if the distribution of the values in the field are, say 99% (0) and 1% (1), and you are searching for values of 1 then the index is beneficial.
Is SQL doing anything clever behind the scenes with bit columns?
It is almost like you want to say index just the small half of the bit column (1 in the above example) to keep the index small, then searches would be possible and efficient.
I've got a few cases like the one above and wouldn't like to think of it searching without an index. And I don't like having to define the column as, say, smallint instead to force indexing.
Does anyone have more information on bit columns / indexes?
Robert
You don't seem to be able to index a bit field in a table. I can sort of understand this as there are only 2 values to index. However if the distribution of the values in the field are, say 99% (0) and 1% (1), and you are searching for values of 1 then the index is beneficial.
Is SQL doing anything clever behind the scenes with bit columns?
It is almost like you want to say index just the small half of the bit column (1 in the above example) to keep the index small, then searches would be possible and efficient.
I've got a few cases like the one above and wouldn't like to think of it searching without an index. And I don't like having to define the column as, say, smallint instead to force indexing.
Does anyone have more information on bit columns / indexes?
Robert