History/audit without history tables I am working on an application development project where another
developer is responsible for the design of the SQL Server 2005
database. Instead of allowing inserts or updates, many important
tables are designed so that "old" versions of records are maintained
in the table and marked as "inactive" using a bit column. For
example, if a user enters his address and then updates it five times,
we will be left with six address records, one of which is active.
I've never used this approach. I typically create a separate table to
capture change history. In my experience, change history is rarely if
ever accessed.
My concern is that this database will eventually handle millions of
customers and these tables will contains millions of "dead" records
SQL Server will need to sift through. It is true that we'll having
indexes on important columns (i.e., CustomerID) so perhaps I shouldn't
worry about it. Nevertheless, I wonder whether this approach is good
practice.
Bill E.
Hollywood, FL |