diff --git a/api/hypercore/convert_to_rowstore.md b/api/hypercore/convert_to_rowstore.md index 2babe2bff5..c48b4f4bef 100644 --- a/api/hypercore/convert_to_rowstore.md +++ b/api/hypercore/convert_to_rowstore.md @@ -7,6 +7,7 @@ api: license: community type: function --- + import Since2180 from "versionContent/_partials/_since_2_18_0.mdx"; # convert_to_rowstore() Community @@ -25,12 +26,12 @@ This workflow is especially useful if you need to backfill old data. To modify or add a lot of data to a chunk: - +1. **Stop the [jobs][alter_job] that are automatically adding chunks to the columnstore** -1. **Stop the [jobs][alter_job] that are automatically adding chunks to the columnstore** ``` sql SELECT alter_job(JOB_ID, scheduled => false); ``` + You retrieve the list of jobs from the [timescaledb_information.jobs][informational-views] view. 1. **Convert the chunks to update back to the rowstore** @@ -49,8 +50,8 @@ To modify or add a lot of data to a chunk: 1. **[Update the data][insert] in the chunk you added to the rowstore** - Best practice is to structure your INSERT statement to include appropriate - partition key values, such as the timestamp. TimescaleDB adds the data to the correct chunk: + Best practice is to structure your INSERT statement to include appropriate + partition key values, such as the timestamp. TimescaleDB adds the data to the correct chunk: ``` sql INSERT INTO metrics (time, value) @@ -58,24 +59,25 @@ To modify or add a lot of data to a chunk: ``` 1. **Convert the updated chunks back to the columnstore** + ``` sql SELECT convert_to_columnstore('_timescaledb_internal._hyper_1_2_chunk'); ``` 1. **Restart the [jobs][alter_job] that are automatically adding chunks to the columnstore** + ``` sql SELECT alter_job(JOB_ID, scheduled => true); ``` - - ## Arguments -| Name | Type | Default | Required | Description | -|--|--|--|--|------------------------------------------------------------------------------------------------------------| -|`chunk`|`REGCLASS`|-|✖| Name of the chunk to be moved to the rowstore. | +| Name | Type | Default | Required | Description| +|--|--|--|--|-| +|`chunk`|`REGCLASS`|-|✖| Name of the chunk to be moved to the rowstore. | |`if_compressed`|`BOOLEAN`|`true`|✔| Set to `false` so this job fails with an error rather than an warning if `chunk` is not in the columnstore | + [job]: /api/:currentVersion:/actions/ [alter_job]: /api/:currentVersion:/actions/alter_job/ [convert_to_columnstore]: /api/:currentVersion:/hypercore/convert_to_columnstore/