> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# split_chunk()

> Split a large chunk at a specific point in time.

export const CHUNK_CAP = 'Chunk';

export const CHUNK = 'chunk';

export const HYPERTABLE_CAP = 'Hypertable';

export const HYPERTABLE = 'hypertable';

<Tag>Community</Tag>

<Icon icon="tag" iconType="duotone" /> Since [2.18.0][tsdb-2.18.0]

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

## Samples

* Split a chunk at a specific time:

  ```sql theme={"dark"}
  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 {CHUNK}s of 12 hours each.

  ```sql theme={"dark"}
  CALL split_chunk('chunk_1');
  ```

## Arguments

The syntax is:

```sql theme={"dark"}
CALL split_chunk(
    chunk = '<chunk_name>',
    split_at = <split_point>
);
```

| Name       | Type     | Default | Required | Description                                                                                                                                                                     |
| ---------- | -------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chunk`    | REGCLASS | -       | ✔        | Name of the {CHUNK} to split.                                                                                                                                                   |
| `split_at` | "any"    | `NULL`  | ✖        | The point at which to split the {CHUNK}. Accepts TIMESTAMPTZ for time-based dimensions or INTEGER for integer-based dimensions. If not specified, the {CHUNK} is split in half. |

## Returns

This function returns void.

[tsdb-2.18.0]: https://github.com/timescale/timescaledb/releases/tag/2.18.0
