Talking TimeSeries part 3

We left off with an insert through the virtual table view. We created a container, a row type, a table, and a virtual table. What if we could simplify this? What if we could avoid creating a container?
One reason why you don't want to create containers could be that you have a lot of data to load and you would need a lot of containers. Would it be nice if Informix could help you with that? Informix can! In the Informix 11.70.xC3 release, we added a capability that does just that.
The new feature if referred to as auto create container. When you insert a new time series in a table and no container is specified, Informix will create one for you if needed. For example, let's take the following table:
CREATE TABLE jroy (
loc_esi_id char(20) NOT NULL PRIMARY KEY,
raw_reads timeseries(meter_data)
) LOCK MODE ROW;
WE can insert a new TimeSeries without specifying a container:
INSERT INTO jroy
VALUES(1, "origin(2010-11-10 00:00:00.00000),calendar(tst15min),threshold(0),regular,[]");
If there is no container available, a container is created as we can see in the tscontainertable table:
SELECT * FROM tscontainertable
name autopool00000000
subtype meter_data
partitiondesc autopool00000000 datadbs 16 16 4194538
flags 1
pool autopool
This features goes a few steps further. If the table is partitioned over multiple dbspaces, Informix will create one container per dbspace and put them in a pool called autopool. It is possible to have the following inserts go through the pool in a round robin fashion to evenly distribute your time series over multiple container and dbspaces.
If you prefer to manage your containers tourseld, you can create your own containers and ut them in a specific pool so you can take advantage of a container pool. You can even create your own policy to decide where new time series should be located.
There is more to know about these capabilities. You can find out more in the information center starting at:
http://publib.boulder.ibm.com/infocenter/idshelp/v117/topic/com.ibm.tms.doc/ids_tms_368.htm?resultof=%22%63%6f%6e%74%61%69%6e%65%72%22%20%22%63%6f%6e%74%61%69%6e%22%20
- 274 reads
-
- Feed: Jacques Roy
- Original article













