Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions api/hypertable/split_chunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,31 @@ products: [cloud, mst, self_hosted]

# split_chunk() <Tag type="community">Community</Tag>

Split a large chunk at a specific point in time.
Split a large chunk at a specific point in time. If you do not specify the timestamp to split at, `chunk`
is split equally.

## Samples

Split a chunk at a specific time:
* Split a chunk at a specific time:

```sql
CALL split_chunk('chunk_1', split_at => '2025-03-01 00:00');
```
```sql
CALL split_chunk('chunk_1', split_at => '2025-03-01 00:00');
```

* Split a chunk in two:

For example, If the chunk duration is, 24 hours, the following command splits `chunk_1` into
two chunks of 12 hours each.
```sql
CALL split_chunk('chunk_1');
```

## Required arguments

|Name|Type| Description |
|---|---|----------------------------------|
| `chunk` | REGCLASS | Name of the chunk to split. |
| `split_at` | `TIMESTAMPTZ`| Timestamp to split the chunk at. |
|Name|Type| Required | Description |
|---|---|---|----------------------------------|
| `chunk` | REGCLASS | ✔ | Name of the chunk to split. |
| `split_at` | `TIMESTAMPTZ`| ✖ |Timestamp to split the chunk at. |


## Returns
Expand Down