The Logic of FailureProgrammers who rationalize their decision-making logic can create suicidal situations for databasesby Joe Celko Knowledge and action don't seem to go together. Roughly 78 percent of respondents to a February DataFlux Corp. survey said their organizations need additional education about the importance of data quality and methods to maintain and improve it. What organizations need to know is that some bad data can't be stopped, just as some traffic accidents aren't preventable. But like most traffic accidents, much bad data can be prevented. In Dietrich Dorner's The Logic of Failure (HarperCollins Publishers, 1997), from which I stole my headline, Dorner traces the reasoning that people used in historical situations that led to an "event cascade," such as the Chernobyl disaster. We create similar lines of reasoning with databases. Look at how many columns are declared with Slips in Common SenseWhen designing a table to hold events, one of the most common designs is to use only one timestamp, thus
The logic is that you can figure out the duration of the event by looking up the next start date, saving space and eliminating a But say the events are a job history and we leave out a job or two; you'd never know that data is missing. While you might not be able to provide the missing data, it's important to at least detect that it's missing. Null Doesn't Mean ZeroI'm an advocate of What if the What if the The IntentAnother invitation to bad data is not putting in obvious check constraints. Or even worse, some developers write the database at the same time as the application code. Then you'll hear, "We put all our integrity constraints in the application," spoken as if it's a good thing. The logic is that the developers know how to write procedural code, but not logical constraints, so they treat the database like a file. It's not clear how programmers can be sure that all future programs will do all these integrity constraints the same way. Oh, and they don't have time to verify that the present applications are doing them either. Bad schema design leads to baroque queries, baroque queries often lead to bad results, and there is your event cascade, paved with good intentions. Joe Celko [celko@northfacelearning.com] is vice president of RDBMS at North Face Learning in Salt Lake City and author of five books on SQL.
|
Most Popular This Week
IE Weekly Newsletter
Subscribe to the newsletter
|
|
|











