![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
If I create a table with 32 columns each declared as BOOL, will the data be stored as bits (32 bits = 4 bytes) or an individual bytes? Will each row be 4 bytes or 32? |
#12
| |||
| |||
|
|
On 2010-09-30 16:51, Sgt Snorkel wrote: If I create a table with 32 columns each declared as BOOL, will the data be stored as bits (32 bits = 4 bytes) or an individual bytes? Will each row be 4 bytes or 32? What is it that you are trying to model using a table with 32 booleans? Not saying that what you are doing is wrong, but I have never encountered such situation, and I'm therefore curios what problem you are trying to solve. |
#13
| |||
| |||
|
|
PPS: I'm surprised that the database system doesn't pack 32 BOOL columns into 4 physical bytes so I don't have to worry about it. |
#14
| |||
| |||
|
|
On Thu, 30 Sep 2010 14:10:41 -0700, Sgt Snorkel wrote: PPS: I'm surprised that the database system doesn't pack 32 BOOL columns into 4 physical bytes so I don't have to worry about it. It gets complicated as all hell when you decide to ALTER TABLE and stick a VARCHAR between the 5th and 6th BOOL if you pack them. Well, actually DOING that wouldn't be that hard, but abstracting it and then autogenerating code to handle moving the data around for ALL combinations of types DOES get complicated. |
#15
| |||
| |||
|
|
On Sat, 02 Oct 2010 01:55:03 GMT, "Peter H. Coffin" hellsop (AT) ninehells (DOT) com> wrote: On Thu, 30 Sep 2010 14:10:41 -0700, Sgt Snorkel wrote: PPS: I'm surprised that the database system doesn't pack 32 BOOL columns into 4 physical bytes so I don't have to worry about it. It gets complicated as all hell when you decide to ALTER TABLE and stick a VARCHAR between the 5th and 6th BOOL if you pack them. Well, actually DOING that wouldn't be that hard, but abstracting it and then autogenerating code to handle moving the data around for ALL combinations of types DOES get complicated. Is there any reason that the physical data has to be in the same order as my columns? |
![]() |
| Thread Tools | |
| Display Modes | |
| |