how to design tables to store random number of columns
- From: derek.gtalk@xxxxxxxxx
- Date: 11 Sep 2006 03:22:22 -0700
Hi,
I want to design a generic solution to store different data sources.
One data source may have 10 columns, while the other may have 100+. I
know a few solutions, but none of them seems ideal. Could you give me
some advice? My solutions are listed below:
1. one record only holds one column. so the table will look like:
data_Id, columnId, dataValue
This table may have millions of records easily.
2. put all the columns into one record as below:
data_Id, column_1, column_2, ..., column_N
Obviously we don't know the N in advance. When we got another data
source which has more columns, have to append more columns to the
existing table. The other drawback is that it wastes lots of space for
other data sources whose number of columns is less than N.
3. the solution combines the above two.
data_Id, segment_Id, column_1, column_2, ..., column_M
For a data source which has N columns, it will have N/M records for
each message data.
Regards,
Derek
.
- Follow-Ups:
- Re: how to design tables to store random number of columns
- From: Tony Rogerson
- Re: how to design tables to store random number of columns
- From: FreeData
- Re: how to design tables to store random number of columns
- From: --CELKO--
- Re: how to design tables to store random number of columns
- From: Jerry Gitomer
- Re: how to design tables to store random number of columns
- From: Ed Prochak
- Re: how to design tables to store random number of columns
- From: Michael Zedeler
- Re: how to design tables to store random number of columns
- Prev by Date: Re: basic SQL query
- Next by Date: Re: how to design tables to store random number of columns
- Previous by thread: DB2 and Informix - Europe Conference IDUG and IIUG 2006: Early registration savings end 14 September!
- Next by thread: Re: how to design tables to store random number of columns
- Index(es):
Relevant Pages
|
Loading