ssystems
11-12-2009, 11:48 PM
I inherited a db structure with the following structure
items
itemId,
.....
attributesValue
attributes
attributeId,
......
value
For the love of God the structure is flat out s****d as its limited to 2^32 or 32 attributes. Even if I increase the value via the data type it would still be limited. On their business logic they just basically do a bitwise operation to extract/retreive the attributes for a particular item which of obviously not scalable. Now I would like to restructure it to an NF3
items
itemId,
.....
attributes
attributeId,
......
itemAttributes
itemAttributeId,
itemId,
attributeId
Of course I can do this via a script or something to populate the itemAttibutes table but I'm just wondering is there a single query command to do bitwise extraction like this. I would like to hear your inputs on any database, MySQL, MSSQL, PG, Ora, etc.
Thanks
items
itemId,
.....
attributesValue
attributes
attributeId,
......
value
For the love of God the structure is flat out s****d as its limited to 2^32 or 32 attributes. Even if I increase the value via the data type it would still be limited. On their business logic they just basically do a bitwise operation to extract/retreive the attributes for a particular item which of obviously not scalable. Now I would like to restructure it to an NF3
items
itemId,
.....
attributes
attributeId,
......
itemAttributes
itemAttributeId,
itemId,
attributeId
Of course I can do this via a script or something to populate the itemAttibutes table but I'm just wondering is there a single query command to do bitwise extraction like this. I would like to hear your inputs on any database, MySQL, MSSQL, PG, Ora, etc.
Thanks