Bug #44469 | my_bitmap overallocates the memory | ||
---|---|---|---|
Submitted: | 24 Apr 2009 18:58 | Modified: | 29 Apr 2009 8:04 |
Reporter: | Konstantin Osipov (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1, 6.0 bzr | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[24 Apr 2009 18:58]
Konstantin Osipov
[29 Apr 2009 8:04]
Sveta Smirnova
Thank you for the report. Verified as described.
[30 Apr 2009 17:14]
MySQL Verification Team
Storing and retrieving values as words vs. bytes is much faster for nearly all modern CPUs and memory systems. I think that storing the bitmap in 4-byte chunks will give much faster data throughput than trying to read single-bytes from the heap. Would you prefer that we work faster, but with a little extra storage or that we work slower and save a few bytes per row? I understand the optimization that you propose but with non-8-bit CPUs it requires a little extra overhead to work data that is not the native word-length for the processor. I think that the overhead of the extra bytes are well spent for the speed improvement it provides.
[2 May 2009 12:27]
Konstantin Osipov
The bug is not in how the bitmap is stored, but how bit offset is calculated. Currently there is a bug in calculation of offsets, that renders 3 out of 4 bytes of the integer unusable.