bit field performance

bit field performance

Post by jim weile » Sat, 26 Jan 2002 00:03:36



1. Is reading/writing to a bit in a bit field 'much' slower than
reading/writing to a byte?

2. 6 bit fields will be in one table. The docs say they will be stored
in 1 byte. If you select the 6 bit fields in one select, is the byte
retrieved once and the bit values extracted into the return value of the
select? Would this be faster than getting the 6 bit values from
individual byte fields?

Thanks for any discussion,
Jim

 
 
 

bit field performance

Post by Brian Dic » Sat, 26 Jan 2002 00:53:58



Quote:> 1. Is reading/writing to a bit in a bit field 'much' slower than
> reading/writing to a byte?

The performance impact of bit fields is minimal. Although, I don't think
they can be indexed. Even if they could be indexed, their low cardinality
would make them practically useless.

Quote:> 2. 6 bit fields will be in one table. The docs say they will be stored
> in 1 byte. If you select the 6 bit fields in one select, is the byte
> retrieved once and the bit values extracted into the return value of the
> select? Would this be faster than getting the 6 bit values from
> individual byte fields?

If a table has multiple bit fields, they are packed into bytes to save
storage. This is their main advantage.

I discourage the use of bit fields. I use the smallint data type. Bit fields
are not compatible with some front end languages and the field domains tend
to evolve beyond two values. Upgrading from bit to another numeric data type
is a pain I try to avoid.

Later,
Brian*

 
 
 

1. Increasing performance of query using a bit field

Hi,

I have a Stored proc that has a query that uses a bit field.  When I run the
query the Execution Plan shows that the 200,000 rows are read in processing
the bit match.  Since I cannot put an index on a bit field, how I can
increase performance?

One thought was to switch to tinyint, but the program's code expects to see
a 1 or 0, not a 255 or 0 and may have problems with NOT conditions.  Also, I
am not sure how the 3rd party controls we use will react to a tinyint.

Thanks,

Jerry

2. SOSP'99 - Call For Participation

3. Performance of Bit fields

4. Open Road and decimal fields

5. Performance of 13 Bit Bit Data for PRIMARY keys

6. Case Insensitive Match using SQL- How to?

7. Performance: 32-bit SE vs. 64-bit EE

8. A Varchar(1000) field vs 1000 Bit fields

9. One-field INDEX performance VS multiple fields index

10. Re : Solaris Performance - 64 bit puzzle

11. Poor 32-bit BDE Performance on LAN Shared Areas