 |
 |
Archives of the TeradataForum
Message Posted: Thu, 05 Jan 2001 @ 01:24:20 GMT
| Subj: | | Re: System Calendar |
| |
| From: | | Sam Mosley |
Warren,
Although I have not attempted to create such a view I would suggest you create a physical table instead, for performance reasons.
The system calendar is itself a view of a view of a view of a table containing one column. Each view adds derived columns. If you
simply go to that view it performs quite well. If you join it to other tables it usually doesn't perform too well. And, since it's
only a single column you can't collect statistics on the derived columns or create indexes to improve performance for your joins.
If, however, you create a table containing all the columns from the system calendar view, and add the derived columns you want, you
will be able to create appropriate indexes, and collect statistics. This will improve your performance to acceptable levels. There
are also some tricky things you can do in date arithmetic to calculate n weeks into a period which perform well, but a phsyical
system date table is much more understandable and maintainable.
Just a few thoughts.
Have a great day.
Sam Mosley
President
VLDB Systems, Inc.
| |