This topic describes the lifecycle of a MaxCompute table.

The lifecycle of a MaxCompute table or its partition starts from the time of the last modification and ends if the table or partition has not undergone any changes within a specific period of time. After the lifecycle ends, MaxCompute automatically reclaims the table or partition. This period of time is the lifecycle of a table or its partition.

  • The lifecycle is measured in days and the value must be a positive integer.
  • If the data in a non-partitioned table remains unchanged within the lifecycle of the table, MaxCompute automatically executes a statement such as DROP TABLE to reclaim the table. The lifecycle of a non-partitioned table starts from the time the data is last modified, which is specified by LastDataModifiedTime.
  • Partitions of a table can be separately reclaimed. MaxCompute automatically reclaims the partitions whose data remains unchanged within the lifecycle. The lifecycle of a partition starts from the time the data is last modified, which is specified by LastDataModifiedTime. Unlike non-partitioned tables, a partitioned table is not deleted even though all of its partitions have been reclaimed.
    Note

    A lifecycle-based table scan is performed at a scheduled time each day to scan all the partitions. If the time of the last modification of a partition exceeds the lifecycle period, MaxCompute automatically reclaims it.

    Assume that the lifecycle of a partitioned table is one day and that data in one of its partitions was last modified at 15:00 on February 17, 2020. If the modification is detected during a table scan before 15:00 on February 18, 2020, the modified partition is not reclaimed. However, if the time of the last modification of this partition exceeds the lifecycle period, the partition is reclaimed during the scan on February 19, 2020.

  • You can configure a lifecycle for tables, but not for partitions. You can specify a lifecycle when you create a table.
  • If no lifecycle is specified, the table or its partitions cannot be automatically reclaimed by MaxCompute based on the lifecycle.

For more information about how to specify and modify the lifecycle of a table or how to modify LastDataModifiedTime of a table, see Table operations.