Creating and Using Calendar Tables

Slides:



Advertisements
Similar presentations
BY LECTURER/ AISHA DAWOOD DW Lab # 2. LAB EXERCISE #1 Oracle Data Warehousing Goal: Develop an application to implement defining subject area, design.
Advertisements

Big Data Working with Terabytes in SQL Server Andrew Novick
Implementing Business Analytics with MDX Chris Webb London September 29th.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 3 – Finding, Filtering,
Dual Partitioning for improved performance in VLDBs Ashwin Rao Karavadi, Rakesh Parida Microsoft IT.
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
Version 1.0. MCAD MCSD MCPD Enterprise SQL MCTS MCT Software/Web Development Consultant Cryptography/Digital Signature Consultant SQL Server 2005/2008R2/2012.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Loading Ola Ekdahl IT Mentors 9/12/08.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Developers of a suite of products to help you monitor and optimize Windows/SQL Server performance o Performance Advisor – awareness and control over Windows.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
Dive into the Query Optimizer Dive into the Query Optimizer: Undocumented Insight Benjamin Nevarez Blog: benjaminnevarez.com
BI Terminologies.
CERN – European Organization for Nuclear Research Administrative Support - Internet Development Services CET and the quest for optimal implementation and.
T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.
Distributed Data Analysis & Dissemination System (D-DADS ) Special Interest Group on Data Integration June 2000.
Measuring referential Integrity in Distributed Databases Dhara Shah.
Oracle Business Intelligence Foundation - Commonly Used Features in Repository.
SQL SERVER AUDITING. Jean Joseph DBA/Consultant Contact Info: Blog:
Or How I Learned to Love the Cube…. Alexander P. Nykolaiszyn BLOG:
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
Oracle Announced New In- Memory Database G1 Emre Eftelioglu, Fen Liu [09/27/13] 1 [1]
Doing fast! Optimizing Query performance with ColumnStore Indexes in SQL Server 2012 Margarita Naumova | SQL Master Academy.
Best Practices for Columnstore Indexes Warner Chaves SQL MCM / MVP SQLTurbo.com Pythian.com.
Database Design: Solving Problems Before they Start! Ed Pollack Database Administrator CommerceHub.
Date Dimension: Past & Future in One Script Steve Wake, BI Developer, Chipotle.
Data Analysis with SQL Window Functions Adam McDonald IT Architect / Senior SQL Developer Smith Travel
SQL Server Statistics and its relationship with Query Optimizer
Using Common Table Expressions
Query Optimization Techniques
Dynamic SQL Writing Efficient Queries on the Fly
Indexes By Adrienne Watt.
Introduction to SQL Server Analysis Services
Self Healing and Dynamic Construction Framework:
The Basics of Dashboards
Introduction to PL/SQL Programing
Date Dimension: One Script for All
UFC #1433 In-Memory tables 2014 vs 2016
Dynamic SQL: Writing Efficient Queries on the Fly
Efficiently Searching Schema in SQL Server
Building Effective Backups
Dynamic SQL Writing Efficient Queries on the Fly
Mapping Shema and Recursively Managing Data
Competing on Analytics II
Monitoring Business Processes Control Charts in Business Objects
Blazing-Fast Performance:
Agenda Database Development – Best Practices Why Performance Matters ?
Query Optimization Techniques
Physical Database Design
Chapter 4 Indexes.
CH 4 Indexes.
Tracking Index Usage Like a Pro
Dynamic SQL: Writing Efficient Queries on the Fly
Please thank our sponsors!
CH 4 Indexes.
Ch 3 Synonym.
Finding Islands, Gaps, and Clusters in Complex Data
Retail Sales is used to illustrate a first dimensional model
Dimensional Model January 16, 2003
Insight into the SQL Server Buffer Cache
Diving into Query Execution Plans
Tracking Index Usage Like a Pro
Finding Islands, Gaps, and Clusters in Complex Data
Query Optimization Techniques
Annoyed with a stubborn pivot table? PowerPivot is your answer.
All about Indexes Gail Shaw.
Finding Islands, Gaps, and Clusters in Complex Data
Dax for most data professionals
Presentation transcript:

Creating and Using Calendar Tables Edward Pollack Creating and Using Calendar Tables

Agenda Making Date Calculations Fast and Efficient What is a calendar table? Simplifying code. Improving maintainability. Performance optimization. Demos Questions?

What is a Calendar Table? Table of dates and date components. Can contain large numbers of metrics. Eliminates date math on-the-fly. Eliminates ad-hoc date-math columns in tables. Used in: Analytics Reporting Anywhere you are sick of…

…this…

Calendar Tables: A Quick Glance Demo Calendar Tables: A Quick Glance

What Can go in a Calendar Table? Any date-based metric you can dream of. Date parts. Relative location in the calendar. String representations. Components of week, month, quarter, year, etc… Weekdays, business days, holidays, holiday seasons. Alternate calendars, such as fiscal, 4-5-4, etc…

Creating a Calendar Table Demo Creating a Calendar Table

Simplifying Code Remove frequent date math from any part of a query. Make TSQL more readable. Reduce mistakes and improve quality.

Demo Simplifying Code

Simplifying Code (cont.) Store very complex calculations for future use. Can include date-based business logic Easter, lunar holidays, alternate calendars, etc… Putting this code into TSQL is messy and error-prone.

Demo Determining Easter

Improving Maintainability Date definitions can be maintained in one place. Reduces repeated code. Creates authoritative source for date-based metrics. No need to reinvent the wheel. Reduce mistakes, increase reliability of code.

Performance Optimization Calendar table rarely/never changes. Calendar table can be heavily indexed. Remove messy functions and date math from filters, aggregates, and ordering. Focuses seeks/scans on the calendar table. Removes complexity from queries on large tables.

Demo More Demos!

Conclusion Calendar tables can: …and they are extremely inexpensive! Simplify code and make it more readable. Improve performance. Improve maintainability. Standardize date-based business logic. Help generate date ranges for processing. Provide a calendar data source in reporting. …and they are extremely inexpensive!

Questions???

Contact Info & Links Ed Pollack ed7@alum.rpi.edu @EdwardPollack SQL Shack SQL Server Central SQL Saturday Albany (2019) Thank you!!!