If storage space is really a big motivator, you can roll your own by using
something like unsigned integers, each of which will accomodate 32 bit fields.
Then use bitmasks to read/write the values.  Probably makes writing WHERE
clauses a bit tedious, and doing joins on the bit fields may not be possible
without a lot of effort.  It would also be a bit slower, since you have to
apply boolean operations every time you read or write a field.  But that's
completely application dependant and it may not add much overhead to your
particular app.  If you can live with those shortcoming, then move the bit
logic into your application.



----- Original Message ----- 
From: "Dan Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, July 13, 2003 11:21 AM
Subject: Re: does mySQL support a boolean data type?


> > why don't you use int(1) and set it to 0 or 1?
>
> Storage space is an issue because I am designing a very large database
> for a client.  Every byte I save per row will translate into many many
> megs.  So if all I need is a single bit for true or false I want to get
> as close to that single bit as possible.  (Although most bools end up
> being more then a single bit because of architecture issues).
>
> So, to put a long story short, I am trying to make every column's
> internal data structure as tiny as possible.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to