3 ms·
Or a table with two columns, Key and Value. Index by key. Specify keys in code with constants. No need to alter table when adding new metrics.
by pvnick 14y ago
Or a table with two columns, Key and Value. Index by key. Specify keys in code with constants. No need to alter table when adding new metrics.
- dustin 14y agoThis!
- bcoates 14y agoPlease don't do this! Entity-Attribute-Value tables are a nightmare waiting to happen about 98% of the time. If there's something wrong with your DBMS where the alter table to add a row is an expensive or dangerous operation, just add a new table for every attribute, having lots of tables in a database is no worse than having lots of variables in a program. If your DBA gets angry at you for adding new tables all the time, get a new DBA.