Manage container pools

By default, containers that are automatically created are added to the default container pool, named autopool.

To add a container into a container pool or move a container from one container pool to another, run the TSContainerSetPool procedure and specify the new container pool name. If the container pool does not exist, it is created.

To remove a container from a container pool, run the TSContainerSetPool procedure without specifying a container pool name.

To delete a container pool, remove all the containers from it.

Example 1: Creating a container and adding it to the default container pool

Suppose that you have a TimeSeries subtype named smartmeter_row, you want to store the time series data in a different dbspace than the table is in, and you do not want to specify the container name when you insert data. The following statements create a container that is called ctn_sm1 for the smartmeter_row time series and add the container to the default container pool:

EXECUTE PROCEDURE TSContainerCreate
                    ('ctn_sm1','tsspace1','smartmeter_row',0,0);
EXECUTE PROCEDURE TSContainerSetPool('ctn_sm1','autopool');

When you insert data for the smartmeter_row time series without specifying a container name, the database server stores the data in the container named cnt_sm1 in the dbspace named tsspace1 instead of creating a container in the same dbspace as the table.

Example 2: Removing a container from the default container pool

Suppose that a container was automatically created for your time series, but you want to stop automatically inserting data into that container. After you create the container for the time series using the process in the first example, you can remove the original container from the default container pool. The following statement removes a container named ctn_sm4 from the default container pool:

EXECUTE PROCEDURE TSContainerSetPool('ctn_sm4');

The container ctn_sm4 still exists, but data is inserting into it only if the INSERT statement explicitly names ctn_sm4 with the container argument.