I have the following database design question:
I have a record that contains the following information:
Primary key consisting of 3 columns
General information details (formed of 7 columns) Record parameters (each parameter has 2 columns but there can be between 0 and 1500 parameters)The current database design for this record is right now:
Table A: Primary key General information detailsTable B:
Primary key (of main record in table A) Sequence number (both Primary key and Sequence number make up the Primary Key of Table B) Record paramters 32 columns (this 32 is more or less a random number)The thing I am wondering about is if this design actualy makes sense at all. Actualy the question makes sense for all cases when we have several (variable number开发者_Go百科) parameter records for a main record.
On the one hand we could have in table B one parameter per line (this would involve more average storage space per stored parameter - primary key would have to be stored n times), on the other hand we could store x paramters per line (less average storage space per stored parameter but might have a random number, less than x of empty storage).Hope I was clear enough about my problem. Any idea what would be the best solution for this?
When you query this data, do you need to filter it by any record parameters? In other words, would any of the record parameters appear in your WHERE clause?
If not, then you could just store them in a single Blob column, e.g. as XML or whatever serialization works best for you.
精彩评论