Relational Bit Fields
Posted: Sat May 06, 2006 5:00 pm
Okay, So heres the setup:
a table with `groups` - relatively small amount, lets say a maximum of 16 for the hell of it.
a table of `users` with the field `groups`
the groups table has an id -> auto_incrementing
the users table has a field `groups` which is a bitwise interpretation of the groups.
UPDATE users SET groups = pow(2,X) + pow(2,Y) + pow(2,Z) for example....
Anyways, I want to make this as efficient as possible.
Right now the id field for the groups is int(1) unsigned
the groups field in the users table is int(4) unsigned.
I have no idea what the maximum amount of groups i can have, which field is going to limit expansion, and whether using int instead of a bit field is a bad idea for optimization purposes.
a table with `groups` - relatively small amount, lets say a maximum of 16 for the hell of it.
a table of `users` with the field `groups`
the groups table has an id -> auto_incrementing
the users table has a field `groups` which is a bitwise interpretation of the groups.
UPDATE users SET groups = pow(2,X) + pow(2,Y) + pow(2,Z) for example....
Anyways, I want to make this as efficient as possible.
Right now the id field for the groups is int(1) unsigned
the groups field in the users table is int(4) unsigned.
I have no idea what the maximum amount of groups i can have, which field is going to limit expansion, and whether using int instead of a bit field is a bad idea for optimization purposes.