dbTalk Databases Forums  

sparse relational table

comp.databases.rdb comp.databases.rdb


Discuss sparse relational table in the comp.databases.rdb forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stanley Yao
 
Posts: n/a

Default sparse relational table - 02-10-2004 , 01:03 PM






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

Reply With Quote
  #2  
Old   
Stanley Yao
 
Posts: n/a

Default Re: sparse relational table - 02-10-2004 , 01:04 PM






On Tue, 10 Feb 2004, Stanley Yao wrote:

Quote:
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
different tables. Sience it's science data, all fields are not clearly
dividable into groups; they are equally part of the whole row. It is
better to store all fields in the same table.
Thanks,
Stan


Reply With Quote
  #3  
Old   
Dr. Dweeb
 
Posts: n/a

Default Re: sparse relational table - 02-20-2004 , 10:00 AM



Stanley Yao wrote:
Quote:
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.




Reply With Quote
  #4  
Old   
Dr. Dweeb
 
Posts: n/a

Default Re: sparse relational table - 02-20-2004 , 10:50 AM



Dr. Dweeb wrote:
Quote:
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.
Oops, I meant to say "... n-columns of n-bytes containing no data is ..."

Quote:
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.