Skip to main content

Time partition

...About 1 min

Time partition


Time partition divides data according to time, and a time partition is used to save all data within a certain time range. The time partition number is represented by a natural number. Number 0 means January 1, 1970, it will increase by one every partition_interval milliseconds. Time partition number's calculation formula is timestamp / partition_interval. The main configuration items are as follows:

  • time_partition_interval
DescriptionTime range for dividing database, time series data will be divided into groups by this time range
EffectiveOnly allowed to be modified in first start up

Configuration example

Enable time partition and set partition_interval to 86400000 (one day), then the data distribution is shown as the following figure:

time partition example
  • Insert one datapoint with timestamp 0, calculate 0/86400000 = 0, then this datapoint will be stored in TsFile under folder 0

  • Insert one datapoint with timestamp 1609459200010, calculate 1609459200010/86400000 = 18628, then this datapoint will be stored in TsFile under folder 18628


When enabling time partition, it is better to enable timed flush memtable, configuration params are detailed in Config manual for timed flush.

  • enable_timed_flush_unseq_memtable: Whether to enable timed flush unsequence memtable, enabled by default.

  • enable_timed_flush_seq_memtable: Whether to enable timed flush sequence memtable, disabled by default. It should be enabled when time partition is enabled, so inactive time partition's memtable can be flushed regularly.

Copyright © 2024 The Apache Software Foundation.
Apache IoTDB, IoTDB, Apache, the Apache feather logo, and the Apache IoTDB project logo are either registered trademarks or trademarks of The Apache Software Foundation in all countries

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.