Quote:
|
Originally Posted by Pat Phelan
Having separate tables for values of "approved" doesn't make any more sense than having separate tables for the values of "product name" to me. The approved status is an attribute, just like name. I'd only have one table.
-PatP
|
If you have them all together in the same table, you will have to do all the time, two different selects to get the one's with the flag set, and the ones without the flag set. You will have to pay attention, in the client application to allways remove the not aproved ones, and all the time a new functionality will be implemented, a new report...you shouldn't forget to select based on the STATUS flag, which gives problems later on for maintainance, for other developers that will come, not knowing what that Status flag means.
If you have 20 mil records aproved (and 10.000 not aproved) all the time you'll want to select either the aproved one, or not, you'll have to go trough all the records. I don't see it liekely to have the case when you'll select both aproved and not aproved records in the same SELECT.
If you have another table for anuthorized(unapproved) you could add there, the status of the unauthorised record, it can vary(some user just wanted to pause his work, another record is on the second level of authorisation, another one, just couldn't be processed from a automatic process.
What I mean, is that in the unauthorised table you can have much more detailed status, and you can hold the information strictly related to the authorisation, which in the one table scenario will all have to be added to the main (approved and unapproved) table.
And with two tables you do not lose performance, from my point of view, you gain performance.
Basically , I do not like Status fields, they tend to be overused, you will want to add another type of Status Code, and that just adds to the complexity and makes it unclear, and not to simplicity. The Authorisation Flag is not the same as a flag "In stock: Yes/No"