Monthly Archives: August 2015

Please Index Foreign Keys


picture by Travis via Flickr

In the database literature, the lore has been to first design a schema and then predict the query mix to decide on a tuning strategy. This approach can work, but it is risky and error prone. A small misjudgment of the query mix can lead to vastly inferior performance. For many applications a better strategy is to index every foreign key. That is often sufficient and further tuning is unnecessary.

Continue reading Please Index Foreign Keys

Six Data Modeling Patterns for Trees


picture by Thor via Flickr

Here’s a chapter from my book Patterns of Data Modeling. This chapter presents six data modeling patterns for trees — UML data models, IE data models, SQL queries, and examples. The book has much more information about patterns including patterns for directed graphs, patterns for undirected graphs, antipatterns, and archetypes.


Do Not Outsource the Data Model and the DB Design

The 360-degree Sydney Harbour control tower of as seen from the Observatory Hill. From the looks of it, it is no longer in operation.

picture by Theen Moy via Flickr

Many organizations today outsource software development. You, the customer, specify your requirements and the vendor is supposed to build software that meets your requirements. But requirements are not sufficient as a specification. With this common scenario, you have no control over the quality of the software being built. Furthermore, you have no visibility into the software’s structure. You can improve this situation by adding a data model and a database design to your specifications.

Continue reading Do Not Outsource the Data Model and the DB Design