Date Dimension Script

  • Comments posted to this topic are about the item Date Dimension Script

  • Well done. It's always nice to see a RBAR-free, set-based approach to building tables like this. A few things I would change to improve performance:

    1. Make all the columns NOT NULLable...
    2. Use smaller numeric data types you have int and bigint for columns where a tinyint or smallint will do the trick. ServiceHoliday could be a bit. 
    3. Update your logic so that the final table has a primary key and clustered index. When I run this locally the finished table has no keys or indexes. 
    4. Include some more nonclustered unique and non-unique indexes. I generally add narrow single-column nonclustered indexes on my dim_date table; we add included columns (or new indexes) as needed.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply