thanks andrew! well, yes, aside from the trivial benefit of having less tables, I was thinking of the occurence of some tables being wasted if not used. As I said, some of the tables may hold only 1 row for the next year and some may not even have the benefit of having any row at all.
Another thing is, the application will be heavily using a function to check if a particular M:M relationship exists. The scenario is actually like this: an
order may have an
invoice, and an
invoice may have a
receipt. Also, an
order may be issued a
receipt directly. The order is paid if a receipt for it exists. The M:M tables would be:
Quote:
order_invoice
invoice_receipt
order_receipt
|
To see if the the order has been paid already, I have to see if an M:M for the particular order exists in the invoice_receipt or in the order_receipt table. If I have used the one-big-table approach, I would only checked one table only; whereas in this one, I first have to check invoice_receipt and if it does not exist, check order_receipt.
This scenario repeats at least 5 times on different combinations for the project.
And also on this note, I would like to ask: in balancing good database design (avoid redundancy, avoid null, etc) versus speed in accessing data (redundant data exists but is taken care of by the application's front-end), where and how do we draw the line?