Time Period Question

Time Period Question

Post by imani_technology_s.. » Wed, 03 Mar 2004 07:34:39



There are several tables that require a starting time period and an
ending time period.  Right now, that time period consists of a quarter
and a year, although that can change in the future.

From a normalization perspective, I think I should have a separate
TimePeriod table and link that table to the other tables that need
time periods.  That will result in two joins each time we want to link
the TimePeriod table with another table (one join for StartingPeriod
and one join for EndingPeriod).  But how will that affect performance?
 From a performance perspective, should we just have the time period
fields in each of the tables where that data is needed?

 
 
 

Time Period Question

Post by David Brown » Wed, 03 Mar 2004 07:44:43



Quote:> There are several tables that require a starting time period and an
> ending time period.  Right now, that time period consists of a quarter
> and a year, although that can change in the future.

> From a normalization perspective, I think I should have a separate
> TimePeriod table and link that table to the other tables that need
> time periods.  That will result in two joins each time we want to link
> the TimePeriod table with another table (one join for StartingPeriod
> and one join for EndingPeriod).  But how will that affect performance?
>  From a performance perspective, should we just have the time period
> fields in each of the tables where that data is needed?

There are two questions here:
 1) What is the best relational schema for my application?

 2) How will a particular option be too expensive for my application?

You asked the second question, which no one but you can answer, and didn't
ask the first which.

David

 
 
 

Time Period Question

Post by imani_technology_s.. » Wed, 03 Mar 2004 23:35:46


Eventually, this data is going to feed into an OLAP cube using a star
schema.  I figured that adding time periods to the other tables
instead of normalizing a separate TimePeriod table would make it
easier for me to "flatten" out the data into a star schema later.
However, I'm not too sure if that's a good idea now.




> > There are several tables that require a starting time period and an
> > ending time period.  Right now, that time period consists of a quarter
> > and a year, although that can change in the future.

> > From a normalization perspective, I think I should have a separate
> > TimePeriod table and link that table to the other tables that need
> > time periods.  That will result in two joins each time we want to link
> > the TimePeriod table with another table (one join for StartingPeriod
> > and one join for EndingPeriod).  But how will that affect performance?
> >  From a performance perspective, should we just have the time period
> > fields in each of the tables where that data is needed?

> There are two questions here:
>  1) What is the best relational schema for my application?

>  2) How will a particular option be too expensive for my application?

> You asked the second question, which no one but you can answer, and didn't
> ask the first which.

> David

 
 
 

1. SQL QUESTION on grouping and sum/avg over a 7 day time period

Hello again folks,

I have a table with various prices. It's something like this,

customer_id
item_id
price_1
price_2
order_qty
date

I need to "group" this table by customer_id and item_id, then average
the prices and sum the order_qty. But the problem is, I need to do
this for a 7 day period starting from the date. How can I do that ?
I'm using db2 7.2 ee.

Thanks very much - CM.

2. Install on 95

3. how to program for period-to-period comparisons ?

4. Meaning of "number of worker processes"

5. Facts that only exist in PERIODS of time

6. MO-ST. LOUIS-113650--UNIX-ORACLE-DBA Skills-DB Programmer

7. Time periods in a star schema?

8. best link for visual basic references

9. Precalculated values and time periods

10. Time Dimension for Fiscal Calendar with 13 periods

11. Parallel Periods and Relative Times ????

12. Aggregations accross time periods

13. Consolidating Contiguous Time Period Rows into one!!!