All Forums Database
tom.gnade 13 posts Joined 03/12
05 Nov 2012
primary index using begin(period)

I have a time-series table with data points that are time periods. I'd like to be able to evaluate the following designs:
create multiset table dropme_t0(
  whatever_id varchar(50),
  data_point_start_dtm timestamp(0), -- in UTC
  data_point_end_dtm timestamp(0) )
  primary index( whatever_id, data_point_start_dtm );
create multiset table dropme_t1(
   whatever_id varchar(50),
   data_point_dtmp period( timestamp(0) ) ) -- in UTC
   primary index( whatever_id, data_point_dtmp )
or at least use begin( data_point_dtmp ) so it can resolve to a basic data type. Is that possible in v14, or will it be in v14.10? I am able to partition on begin( data_point_dtmp ) without a problem in v13.10, but it is rejected as a syntax error when I attempt to use it in the PI.
I have used 3 different methods to store this data:
method 1: implement as a pair of timestamps
method 2: implement as a start timestamp and an interval day(3) to second(0)
method 3: implement as a period data type
I think the advantage of method 3 is that the period constructor has already been called at storage time, rather than at read time, which is what is required for method 2.

You must sign in to leave a comment.