Re: Database design pattern question
- From: jerry gitomer <jgitomer@xxxxxxxxxxx>
- Date: Mon, 18 Jul 2005 13:09:06 GMT
Andrew McLean wrote:
In article <1121628648.995189.91800@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, --CELKO-- <jcelko212@xxxxxxxxxxxxx> writesDon't worry about understanding it for now. (If you choose to do more research on data bases you will understand it.) Just accept the fact that Joe knows what he is talking about and unless you have a good reason to do otherwise it is best to take his advice.
This design fallacy is called attribute splitting. You are putting things that belong to one entity split over multiple tables.
I'm afraid I don't understand this point.
Andrew,Temporal things are stored with a (start, end) timestamp pair. They have durations and are not points in time. You can get the details at University of Arizona's website -- look up Rick Snodgrass and download his book.
The book looks very interesting. Thank you.
I suppose it might help if I explain a bit more about my application. Some of the data comes from different sources, with different levels of reliability. So for instance my event tables might store information about the source of the data as well as the time stamp and the data itself. I can also imagine wanting queries which use data from the most reliable source rather than the most recent.
A better example attribute might be surveying a person's favourite colour at different times. Really all you have is a snapshot in time. There isn't really an interval of validity resulting from the survey. Although once I have read Snodgrass I might get a feel for whether it is helpful to use an interval for which the information is most current.
The disadvantage of this approach would be that I could no longer simply merge multiple copies of the database by forming unions of the event tables.
I should really emphasise that the ability to update multiple copies of the database then merge them is the key issue I am trying to solve. Keeping a transaction log may be a better solution than what I was proposing, but I have a prejudice against having the same information recorded in multiple places.
The fact that you can have multiple occurrences of an attribute tells us that you have a one-to-many situation and not a simple one-to-one situation.
That being the case you should have two tables; one for persons and a second for attributes. The attributes table would contain columns for person_id, attribute id, value, date and reliability.
Your basic queries would then consist of a subquery against the attributes table to select the latest or the most reliable with the result being joined with the persons table.
A transaction file is, IMHO, mandatory. If your RDBMS doesn't maintain one you should. The reason is that any disk drive will, sooner or later, suffer a catastrophic failure. When it does it will be necessary to replace the disk drive and then rebuild your database using your most recent backup and a transaction file containing the transactions that have been processed since the backup was made.
The intent of the transaction file is to assist in disaster recovery and, if you wish, to provide an audit trail. It is not intended to be used for ordinary data processing.
HTH Jerry .
- Follow-Ups:
- Re: Database design pattern question
- From: Andrew McLean
- Re: Database design pattern question
- References:
- Database design pattern question
- From: Andrew McLean
- Re: Database design pattern question
- From: --CELKO--
- Re: Database design pattern question
- From: Andrew McLean
- Database design pattern question
- Prev by Date: Re: untypical problem
- Next by Date: Requesting advise for design strategy
- Previous by thread: Re: Database design pattern question
- Next by thread: Re: Database design pattern question
- Index(es):
Relevant Pages
|