TSContainerNElems function
The TSContainerNElems function returns the number of time series data elements stored in the specified container or in all containers.
Syntax
TSContainerNElems(container_name varchar(128,1));
TSContainerNElems(container_name varchar(128,1)
rw_flag integer default 0);
- container_name
- Specifies which container to return information about. Must be an existing container name. You can include wildcard characters from the MATCHES operator: *, ?, [...], \, ^. The function returns information for all containers that have names that match the expression. See MATCHES Operator.
- The value NULL returns information about all containers for the database.
- rw_flag
- For rolling window containers, specifies for which partitions to return the sum of number of elements:
- 0 = The partitions in the active window
- 1 = The partitions in the dormant window
- 3 = The container partition. The number of elements equals the number of intervals in the active and dormant windows.
- 4 = All partitions.
Description
Use the TSContainerNElems function to view the number of elements stored in a container. For rolling window containers, the TSContainerNElems function returns the sum of the number of elements in the specified set of partitions.
Returns
The number of elements.
Example
The following statement returns the number of elements stored in the container named mult_container:
EXECUTE FUNCTION TSContainerNElems("mult_container");
elements
26
1 row(s) retrieved.
The following statement returns the number of elements stored in all containers:
EXECUTE FUNCTION TSContainerNElems(NULL);
elements
241907
1 row(s) retrieved.