Skip site navigation (1) Skip section navigation (2)

Re: extract(field from timestamp) vs date dimension

From: Tobias Brox <tobias(at)nordicbet(dot)com>
To: Chad Wagner <chad(dot)wagner(at)gmail(dot)com>
Cc: Tobias Brox <tobias(at)nordicbet(dot)com>,pgsql-performance(at)postgresql(dot)org
Subject: Re: extract(field from timestamp) vs date dimension
Date: 2007-01-23 13:35:48
Message-ID: 20070123133548.GA17420@oppetid.no (view raw or flat)
Thread:
Lists: pgsql-performance
[Chad Wagner - Tue at 08:24:34AM -0500]
> I guess go with your gut, but at some point the expressions are going to be
> too complicated to maintain, and inefficient.

The layout of my system is quite flexible, so it should eventually be
fairly trivial to throw in a date dimension at a later stage.

> Calendar tables are very very common, because traditional date functions
> simply can't define business logic (especially things like month end close,
> quarter end close, and year end close) that doesn't have any repeating
> patterns (every 4th friday, 1st monday in the quarter, etc).  Sure you can
> stuff it into a function, but it just isn't as maintainable as a table.

So far I haven't been bothered with anything more complex than "clean"
weeks, months, quarters, etc.

I suppose the strongest argument for introducing date dimensions already
now is that I probably will benefit from having conform and
well-designed dimensions when I will be introducing more data marts.  As
for now I have only one fact table and some few dimensions in the
system.


In response to

Responses

pgsql-performance by date

Next:From: Bill MoranDate: 2007-01-23 13:53:25
Subject: Re: slow result
Previous:From: Chad WagnerDate: 2007-01-23 13:24:34
Subject: Re: extract(field from timestamp) vs date dimension

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group