![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, If the nature of the data to be stored in a database is like the following, what is a more efficient method of storing them? For a table in the database, there are a large number of possible fields (mostly of type integer, float and strings), but each row has a different set of fields available and other fields are N/A. Field sets of rows overlap some but still have much non-overlaping. For example, all possible files are F1, F2, ..., F50. Row 1 only has F1, F6, F8, ..., F47, F49. Row 2 has F1, F2, F5, F6, F10, ..., F46, F49, F50. And so on. If the table is created with a schema including all possible files (F1 through F50), many fields in the database is just empty which is not very efficient. What is a better way of storing this kind of data? Is document-oriented database (XML) better? Are there better ones than XML? Thanks, Stan I just want to add that it is not obvious how to break all fields into |
#3
| |||
| |||
|
|
Hi, If the nature of the data to be stored in a database is like the following, what is a more efficient method of storing them? For a table in the database, there are a large number of possible fields (mostly of type integer, float and strings), but each row has a different set of fields available and other fields are N/A. Field sets of rows overlap some but still have much non-overlaping. For example, all possible files are F1, F2, ..., F50. Row 1 only has F1, F6, F8, ..., F47, F49. Row 2 has F1, F2, F5, F6, F10, ..., F46, F49, F50. And so on. If the table is created with a schema including all possible files (F1 through F50), many fields in the database is just empty which is not very efficient. What is a better way of storing this kind of data? Is document-oriented database (XML) better? Are there better ones than XML? Thanks, Stan |
#4
| |||
| |||
|
|
Stanley Yao wrote: Hi, If the nature of the data to be stored in a database is like the following, what is a more efficient method of storing them? For a table in the database, there are a large number of possible fields (mostly of type integer, float and strings), but each row has a different set of fields available and other fields are N/A. Field sets of rows overlap some but still have much non-overlaping. For example, all possible files are F1, F2, ..., F50. Row 1 only has F1, F6, F8, ..., F47, F49. Row 2 has F1, F2, F5, F6, F10, ..., F46, F49, F50. And so on. If the table is created with a schema including all possible files (F1 through F50), many fields in the database is just empty which is not very efficient. What is a better way of storing this kind of data? Is document-oriented database (XML) better? Are there better ones than XML? Thanks, Stan The idea that n-coulmns of n-bytes is inefficient per se, is deluded. |
|
This is an implementation issue of the specific database in question. It is not necessarily wasted and it is not necessarily inefficient. In fact this I suspect the idea is only applicable to the most mindboggingly primitive database engines. I need to know more about what the columns mean to determine whether your design is logically valid though, as you give no udesful information Dr. Dweeb. |
![]() |
| Thread Tools | |
| Display Modes | |
| |