Constraints are a necessary part of the tug-and-thrust of database design, but once in a while, when designing a data warehouse, someone comes up with the question “Do I need to map those constraints to my DW?” The simple answer is “Yes”, but it’s also a somewhat naive answer that doesn’t take into account the needs of a DW.

For your primary key, consider using a surrogate or alternate key; you’ll need to cater for slowly changing dimensions, e.g. if you’re doing a report over the last 5 years on average sales per married/unmarried salesperson, you’ll want to register the fact that someone was unmarried for 2 years, then married for the last 3. This means your data warehouse will have two dimension-table rows for the same person. Following the OLTP structure for that will be hard, to say the least. Note that it’s not enough to create a composite key on the original primary key and e.g. marital status — the same person may also have other fields that change occasionally, such as address (zipcode), department, job title, or even gender!

As for other constraints such as default value or check constraints, we need to consider how a DW is populated, and what the arrival of data to the DW means. The DW is invariably populated from an OLTP (relational) system, the same system that typically has all the original constraints. Ideally, this means the data is already clean by the time the DW gets it. It also means that the performance hit required by checking these constraints in writing to the database has already been taken. And OLTP system is typically optimised for writes and reads, particularly the large tables that change frequently and are the subject of most of the storage in a DW.

On the other hand, Data Warehouses are massively optimised for reads (assuming you’re populating as a batch, with reasonably high latency), and constraints don’t really factor in read operations. You can typically get around any constraint issues with your DW populating job, if they haven’t already been dealt with in the OLTP system, and deal with nulls etc. at the analysis/reporting tools if necessary. It’s far more important to make sure default values fit with your conceptual data model, and don’t introduce issues at the DW client tools.

Tags: ,

Leave a Reply

  • chad ochocinco career stats
  • bangles eternal flame mp3bengals forum
  • tea party lies
  • memo
  • vince young redskins
  • search engines for kids
  • randy moss combine results
  • chad ochocinco parents
  • arno
  • hp support quick test pro
  • astronomy
  • new england patriots underwear
  • new england patriots 1997 roster
  • dashboard
  • tea party table settings
  • bea exhibitors
  • c span 4 to 5
  • battleship hacked
  • hyosung
  • tea party zombies download
  • search 3 bodybuilding other index
  • bengals preseason schedule 2011
  • carwash
  • mtv rivals
  • bengals history
  • randy moss legal issues
  • zara phillips husband
  • vince young uncle rico
  • vince young dadvince young eagles
  • chad ochocinco and cheryl burke
  • trojans
  • search 50 cent
  • search engines other than google
  • chad ochocinco to detroit
  • la ink ink
  • textured
  • battleship aurora
  • tims
  • glaze
  • northfield
  • vince young released
  • canary
  • la ink 105
  • c span yesterdayc span zelaya
  • new england patriots espn blog
  • speak
  • new england patriots 3 4
  • zara phillips wedding date
  • fenwick
  • new england patriots gillette stadium
  • chicago bears 17 lisa lampanelli
  • federated
  • battleship ipad
  • infrared
  • comforters
  • tea party manifesto
  • chicago bears expo 2011
  • chad ochocinco quotes video
  • steering
  • bea per capita income
  • bengals arrests
  • disassembledis boards
  • nicu
  • dis quand reviendras-tu
  • dis tester
  • chad ochocinco ultimate catch cast
  • stronger
  • bengals undraftedbengals vs steelers
  • cspan ap government review
  • connecticut renaissance faire
  • powertrain
  • bengals hard knocks episode 1
  • hp support error 1005
  • c span youtube obama
  • hp support 6310hp support 7200
  • towns
  • tint
  • cspan facebook
  • la ink 3rd season
  • hangers
  • chicago bears gifts
  • vince young 10 11
  • digitizing
  • connecticut food bank
  • mtv executivesmtv fantasy factory
  • hp support contact number
  • tea party hobbits
  • greg olsen puzzles
  • bea 2011 map
  • chad ochocinco xpchad ochocinco youtube
  • bengals qb situation
  • randy moss college
  • c span shelby foote
  • pudding
  • zara phillips and the queen
  • rufus
  • tea party chicago
  • hp support chat
  • bea goldfishberg
  • randy moss 98 vikings
  • zara phillips school
  • dis pater
  • tea party 8 28 09
  • michelin
  • tea party medicare
  • sticky
  • chicago bears tattoos
  • chicago bears 08 record
  • vince young endorsementsvince young foundation
  • cspan presidents
  • battleship kirishima
  • search and seizure
  • zara phillips and the queen
  • mtv youtube channel
  • search 78search 800 numbers
  • battleship yamato wreck
  • mtv live
  • la ink phone number
  • tea party zombies download
  • beagle
  • battleship lexington
  • bengals merchandise
  • battleship excel
  • dist 95
  • greensboro
  • search xml file
  • dailymotion
  • bea fox
  • bea rims
  • hp support chat
  • bengals cats for sale
  • hp support id
  • bengals new uniforms 2012
  • polos
  • cspan washington correspondents dinner 2011
  • bridesmaid
  • vince young injury
  • xanadu bengals
  • randy moss korey stringer
  • chad ochocinco vs skip bayless
  • opera
  • bea 0b0 105
  • vince young yahoo stats
  • bengals insider
  • squadron
  • dis poem
  • vince young jay cutler
  • hp support 6500a plus
  • mtv 5 cover
  • nozzle
  • bea 4603
  • bengals forum
  • bengals football
  • hp support 530
  • battleship bismarck wreck
  • freida pinto jeansfreida pinto kissing
  • hp support hard drive replacement
  • mtv oddities
  • scored
  • tea party ribbons
  • christina
  • birthdate
  • vince young 6
  • mtv 90s music videos
  • zara phillips tongue
  • search vim
  • bea test
  • connecticut lottery
  • freida pinto 1995
  • randy moss vikings 2011
  • dis 2012 conference
  • vince young status
  • connecticut quarter error
  • dis boards cruise
  • connecticut state parks
  • new england patriots 07
  • search 5500
  • vince young z
  • search tumblr
  • vince young rumors
  • c span yesterdayc span zelaya
  • connecticut 97.7connecticut attorney general
  • bea oracle
  • randy moss bio
  • freida pinto boyfriend