question on creating time serise type of datawarehouse fac.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



i need some insight on some time analysis query on a transaction table.
queries are liked:
find out the hours (duration) for this month an airplane has been parked at
the gate.
find out the dates when the gate is most occupied by which flight.
find out the local time and date (pacific) and eastern time and date (new
york) when gate is most frequently occupied
and etc.
find out the gate was use for a given holiday.
find out the money generated for a given time.

the query is from a transactional fact table with arrival and departure
information.

create table arrival_departure (
flight_id int
airport_gate_id int
date_time_stamp datetime
rate_for_docking money
)

I am thinking of creating a date_dim table and a time_dim and a view.
the date_dim will have key, day, date, month, hoilday, and etc info. the
time will have minute, hour info for local pacific time. given there is a 4
hours time difference betweeen pacific and eastern time, i am considering to
adding another set of min, hour for eastern time.
the view will have all three columns from arrival_departure table plus a
date_id column reference key of date_dim and a time_id column reference key
of time_dim.

so my questions is I am not sure if it was a good idea to add eastern time
columns to time_dim.
secondly, i still don't have a query to find duration of when a flight_id
was at a airport_gate.

sample data for arrival_departure
flight_id airportgate date_time_stamp
111 1 2009/1/1 0:01
222 2 2009/1/1 0:12 -- arriving
333 3 2009/1/1 1:21
222 2 2009/1/1 1:45 -- leaving
111 1 2009/1/1 1:46 -- leaving
666 1 2009/1/1 1:55 -- arriving

ideally, the arrival_departure would be arranged into this:
fligh_id 111 was there for the hour one and two (from 0:01am to 01:45am on
1/1)
flight_id 222 was there from hour one and hour 2 (from0:12 am to 1:45 am)

date hour duration fligh_id
1/1 1 0:00-1:00 111
1/1 2 1:59-2:00 111
1/1 1 0:00-1:00 222
1/1 2 1:59-2:00 222
1/1 2 1:59-2:00 333
1/1 2 1:59-2:00 666

.



Relevant Pages

  • need help on tackle a time series problem
    ... i need some insight on some time analysis query on a transaction table. ... find out the dates when the gate is most occupied by which flight. ... hours time difference betweeen pacific and eastern time, ... date_id column reference key of date_dim and a time_id column reference key ...
    (microsoft.public.sqlserver.programming)
  • Re: need help on tackle a time series problem
    ... it should be pretty simple for you to take my query and join that to a 'numbers' table of 0-23. ... ArrivalDate = ArrivalDateTime, ... given there is a 4 hours time difference betweeen pacific and eastern time, i am considering to adding another set of min, hour for eastern time. ... the view will have all three columns from arrival_departure table plus a date_id column reference key of date_dim and a time_id column reference key of time_dim. ...
    (microsoft.public.sqlserver.programming)
  • Re: need help on tackle a time series problem
    ... ArrivalDate = ArrivalDateTime, ... find out the hours (duration) for this month an airplane has been parked at ... hours time difference betweeen pacific and eastern time, ... date_id column reference key of date_dim and a time_id column reference key ...
    (microsoft.public.sqlserver.programming)
  • Re: server-side profiling
    ... Going back to the server side tracing as mentioned on the link I added to ... most especially if TEMP variable is pointing to Drive C: and that Profiler ... > a query. ... > Duration and Reads are commonly monitored together because they can both ...
    (microsoft.public.sqlserver.server)
  • Re: server-side profiling
    ... Although rows are stored in tables in SQL Server, ... of a query, rows are retreived from these on-disk 8kb pages but a caching ... The Reads column in the Profiler displays LOGICAL reads. ... Duration and Reads are commonly monitored together because they can both be ...
    (microsoft.public.sqlserver.server)