I'm looking for some guidance on deciding between using a bitwise scheme
or a mapping table. I have an "events" table with "type" and a
corresponding "types" definition table. I want to change from one type
per event to many. I am considering:
1. Storing the types as bits in the "events" table. I can join them
with "where types.type & events.type = types.type"
2. Using a mapping table like "eventsToTypes" to connect the two tables.
I am more familiar with the second method but I like the bits approach
because it lets me do things like search for "any of the following event
types" very easily and the number of types of events is limited to what
will fit in a 32-bit integer.
Any thoughts? How does that type of bitwise operation perform in
comparison to the mapping table (where the key may be either an integer
or a UUID)?
sfpug by date
|Next:||From: Josh Berkus||Date: 2007-10-14 21:07:19|
|Subject: Re: Using bitwise operator vs. mapping table|
|Previous:||From: Quinn Weaver||Date: 2007-10-12 21:42:33|
|Subject: Sean Chittenden talk slides?|