[development] User Status [WAS: User last access]
David Strauss
david at fourkitchens.com
Sat May 3 18:04:33 UTC 2008
No, char(0). MySQL uses one bit to store the NULL/not NULL state.
-----Original Message-----
From: Ivan Sergio Borgonovo <mail at webthatworks.it>
Date: Sat, 3 May 2008 19:24:27
To:development at drupal.org
Subject: Re: [development] User Status [WAS: User last access]
On Sat, 03 May 2008 10:59:42 -0400
Aaron Winborn <winborn at advomatic.com> wrote:
> i agree here. the storage would be trivial, considering how much
> other data we store anyway. even if you have 500k users, that would
> add what? an additional 8 char(0) fields would be something
> like .5M, but the db would still be so large that that's a small
> percentage.
> David Strauss wrote:Remember that MySQL cannot truly index
> bitmasks. Consider a series of CHAR(0) columns, which would take
char(0) wouldn't it be char(1)
> the same space but be indexable.
I agree in choosing the data that best represent what you're putting
in.
Beware that char(1) is UTF8 char that may involve a bit of overhead
and is not invariant for ordering on change of locale.
The smallest int in SQL92 standard is smallint aka int2 that is 2
bytes.
Many DB support aggregation of boolean data type, that mean you're
not going to waste 1 byte for each boolean.
Many DB have aggregate function for boolean too.
Modern CPU have a strange relationship with data smaller than one
word.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
More information about the development
mailing list