[development] User Status [WAS: User last access]

Ivan Sergio Borgonovo mail at webthatworks.it
Sat May 3 17:24:27 UTC 2008


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