IBMInformix provides local support for processing time series data. The TimeSeries data type provided in IBMInformix helps reduce storage costs and improve performance when you select and load large amounts of time series data. In this article, you will learn how to start creating and loading time series data.
IBM Informix provides local support for processing time series data. The TimeSeries data types provided in IBM Informix help reduce storage costs and improve performance when you select and load large volumes of time series data. In this article, you will learn how to start creating and loading time series data.
In addition, the Virtual Table Interface makes the time series look like a normal Table. This document also describes the general architecture of the IBM Informix time series component, the steps for creating and loading a time series, and the use of the Open Admin tool to manage a time series.
The IBM Informix TimeSeries solution improves functionality and extends support for time series data storage, operations, and access. It enables you to freely manage time series data by selecting the time series interval and the storage location of the specified time series.
Time series data is a set of data. Each of these data items has a timestamp and can be accessed in chronological order for processing and analysis. The main advantages of the Informix TimeSeries solution include the following.
- Compared with the traditional relational method, it saves up to 80% of storage space.
- Compared with the traditional relational method, the performance of processing temporal data is improved by several orders of magnitude.
- Reduces application development costs through built-in routines.
- The Open Admin Tool simplifies management.
This document describes how to process time series data. To create and load a TimeSeries involves processing the following components.
- Calendar
- Calendar Mode
- TimeSeries Column
- TimeSeries container
This article also shows you how to perform the following activities.
- Create a TimeSeries
- Load data
To start using TimeSeries, you must first create a buffered log database.
TimeSeries Architecture
The TimeSeries subtype is a ROW set. A row data type is composed of Columns with the same data type or different data types. When defining a TimeSeries, Informix can use its own calendar and TimeSeries start date.
The overall architecture and different components of TimeSeries are described as follows. The two main components are TimeSeries data type and TimeSeries sub-type (Row data type ). The TimeSeries data type acts as a Type constructor of the TimeSeries subtype (a ROW set. The ROW data type contains a single database column consisting of a group of named columns that have the same or different data types you have defined.
The timestamp column must be the first column with the datetime year to fraction (5) type. In the example shown in figure 1, the table contains the meter_id column (including the meter number) and meter_data column (including TimeSeries ). Each table row contains different TimeSeries. In this example, the three rows in the table have a TimeSeries of the sub-type meter_data. The structure of the element is defined by the row child type of TimeSeries.
Figure 1. TimeSeries Architecture
Calendar and calendar mode data types
The calendar defines when TimeSeries data is required. Before defining a table containing the TimeSeries column, you need to create a calendar based on the expected TimeSeries data frequency. There are some built-in calendars for quick use.
To set a calendar, you must create a calendar mode and create a calendar.
Create calendar Mode
To create a calendar mode, you must insert a value in the CalendarPatterns table.
The example in Listing 1 shows how to create a calendar pattern named sm_15min. This mode is measured in minutes and has a valid input every 15 minutes.
List 1. Create calendar Mode
INSERT INTO CalendarPatterns values ( 'sm_15min', '{1 on , 14 off},minute');
Create calendar
To create a calendar, you must insert a value in the CalendarTable table. Listing 2 shows how to insert a calendar named cal_15min into the CalendarTable table.
List 2. Create a calendar
insert into CalendarTable(c_name, c_calendar)values ('cal_15min', 'startdate(2012-01-01 00:00:00), pattstart(2012-01-01 00:00:00), pattname(sm_15min)');
This calendar starts from January 1, January 1, 2012. The Mode also starts from 00:00:00, January 1, January 1, 2012. It uses the mode sm_15min created in the previous step.