Skip to content

Commit 1bdd4fd

Browse files
chore: update chunk info information. (#4224)
* chore: update chunk info information.
1 parent bbcb60c commit 1bdd4fd

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

_partials/_chunk-interval.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
$PG builds the index on the fly during ingestion. That means that to build a new entry on the index,
2+
a significant portion of the index needs to be traversed during every row insertion. When the index does not fit
3+
into memory, it is constantly flushed to disk and read back. This wastes IO resources which would otherwise
4+
be used for writing the heap/WAL data to disk.
5+
6+
The default chunk interval is 7 days. However, best practice is to set `chunk_interval` so that prior to processing,
7+
the indexes for chunks currently being ingested into fit within 25% of main memory. For example, on a system with 64
8+
GB of memory, if index growth is approximately 2 GB per day, a 1-week chunk interval is appropriate. If index growth is
9+
around 10 GB per day, use a 1-day interval.
10+
11+
You set `chunk_interval` when you [create a $HYPERTABLE][hypertable-create-table], or by calling
12+
[`set_chunk_time_interval`][chunk_interval] on an existing hypertable.
13+
14+
15+
16+
[best-practices]: /use-timescale/:currentVersion:/hypertables/#best-practices-for-time-partitioning
17+
[chunk_interval]: /api/:currentVersion:/hypertable/set_chunk_time_interval/
18+
[hypertable-create-table]: /api/:currentVersion:/hypertable/create_table/

use-timescale/hypertables/improve-query-performance.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ keywords: [hypertables, indexes, chunks]
66
---
77

88
import OldCreateHypertable from "versionContent/_partials/_old-api-create-hypertable.mdx";
9+
import ChunkInterval from "versionContent/_partials/_chunk-interval.mdx";
910

1011
# Improve hypertable and query performance
1112

@@ -27,11 +28,7 @@ Adjusting your hypertable chunk interval can improve performance in your databas
2728

2829
1. **Choose an optimum chunk interval**
2930

30-
The default chunk interval is 7 days. You can set a custom interval when you create a hypertable.
31-
Best practice is that prior to processing, one chunk of data takes up 25% of main memory, including the indexes
32-
from each active hypertable. For example, if you write approximately 2 GB of data per day to a database with 64
33-
GB of memory, set `chunk_interval` to 1 week. If you write approximately 10 GB of data per day on the same
34-
machine, set the time interval to 1 day. For more information, see [best practices for time partitioning][best-practices].
31+
<ChunkInterval />
3532

3633
In the following example you create a table called `conditions` that stores time values in the
3734
`time` column and has chunks that store data for a `chunk_interval` of one day:

use-timescale/hypertables/index.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ keywords: [hypertables]
66
---
77

88
import HypertableIntro from 'versionContent/_partials/_hypertable-intro.mdx';
9+
import ChunkInterval from "versionContent/_partials/_chunk-interval.mdx";
910

1011
# Hypertables
1112

@@ -63,11 +64,9 @@ to fit into memory so you can insert and query recent data without
6364
reading from disk. However, having too many small and sparsely filled chunks can
6465
affect query planning time and compression.
6566

66-
Best practice is to set `chunk_interval` so that prior to processing, one chunk of data
67-
takes up 25% of main memory, including the indexes from each active $HYPERTABLE.
68-
For example, if you write approximately 2 GB of data per day to a database with 64 GB of
69-
memory, set `chunk_interval` to 1 week. If you write approximately 10 GB of data per day
70-
on the same machine, set the time interval to 1 day.
67+
<ChunkInterval />
68+
69+
7170

7271
For a detailed analysis of how to optimize your chunk sizes, see the
7372
[blog post on chunk time intervals][blog-chunk-time]. To learn how

0 commit comments

Comments
 (0)