CREATE TABLE extends the standard CREATE TABLE. This page explains the features and
arguments specific to .
Samples
-
Create a hypertable partitioned on the time dimension and enable :
- Create the hypertable:
- Enable by adding a columnstore policy:
-
Create a hypertable partitioned on the time with fewer chunks based on time interval:
-
Create a relational table
Arguments
The syntax is:| Name | Type | Default | Required | Description |
|---|---|---|---|---|
tsdb.hypertable | BOOLEAN | true | ✖ | Create a new hypertable for time-series data rather than a standard relational table. |
tsdb.partition_column | TEXT | true | ✖ | Set the time column to automatically partition your time-series data by. |
tsdb.chunk_interval | TEXT | 7 days | ✖ | Change this to better suit your needs. For example, if you set chunk_interval to 1 day, each chunk stores data from the same day. Data from different days is stored in different chunks. |
tsdb.create_default_indexes | BOOLEAN | true | ✖ | Set to false to not automatically create indexes. The default indexes are:
|
tsdb.associated_schema | REGCLASS | _timescaledb_internal | ✖ | Set the schema name for internal hypertable tables. |
tsdb.associated_table_prefix | TEXT | _hyper | ✖ | Set the prefix for the names of internal hypertable chunks. |
tsdb.orderby | TEXT | Descending order on the time column in table_name. | ✖ | The order in which items are used in the . Specified in the same way as an ORDER BY clause in a SELECT query. |
tsdb.segmentby | TEXT | No segmentation by column. | ✖ | Set the list of columns used to segment data in the for table. An identifier representing the source of the data such as device_id or tags_id is usually a good candidate. |