1. Home
  2. Knowledge Base
  3. ChistaDATA
  4. Check Current TTL Settings in ClickHouse
  1. Home
  2. Knowledge Base
  3. ClickHouse
  4. Check Current TTL Settings in ClickHouse
  1. Home
  2. Knowledge Base
  3. ClickHouse Performance
  4. Check Current TTL Settings in ClickHouse

Check Current TTL Settings in ClickHouse

Run a query on system.parts to see the absolute TTL values for a particular piece of data. For each section, columns indicate any TTL restrictions that are currently in effect.

SELECT *
FROM system.parts
WHERE (database = 'default') AND (table = 'my_table')
FORMAT Vertical

Query id: 07ec5747-899a-4deb-93e2-4265eee59a49

Row 1:
──────
partition:                             tuple()
name:                                  all_1_1_0
uuid:                                  00000000-0000-0000-0000-000000000000
part_type:                             Compact
active:                                1
marks:                                 2
rows:                                  1
bytes_on_disk:                         86
data_compressed_bytes:                 37
data_uncompressed_bytes:               11
marks_bytes:                           48
secondary_indices_compressed_bytes:    0
secondary_indices_uncompressed_bytes:  0
secondary_indices_marks_bytes:         0
modification_time:                     2023-07-04 12:19:19
remove_time:                           1970-01-01 00:00:00
refcount:                              1
min_date:                              1970-01-01
max_date:                              1970-01-01
min_time:                              1970-01-01 00:00:00
max_time:                              1970-01-01 00:00:00
partition_id:                          all
min_block_number:                      1
max_block_number:                      1
level:                                 0
data_version:                          1
primary_key_bytes_in_memory:           0
primary_key_bytes_in_memory_allocated: 0
is_frozen:                             0
database:                              default
table:                                 my_table
engine:                                MergeTree
disk_name:                             default
path:                                  /var/lib/clickhouse/store/86d/86d581a1-de69-45ab-bd72-adaccb1da82f/all_1_1_0/
hash_of_all_files:                     f07981c60ea74ea4f1befde4300b8c2c
hash_of_uncompressed_files:            aaced08ebd8b989aea25d60f05cfa4bc
uncompressed_hash_of_compressed_files: 7966bb36aabef6e7063e467c203afe69
delete_ttl_info_min:                   1970-01-01 00:00:00
delete_ttl_info_max:                   1970-01-01 00:00:00
move_ttl_info.expression:              []
move_ttl_info.min:                     []
move_ttl_info.max:                     []
default_compression_codec:             LZ4
recompression_ttl_info.expression:     []
recompression_ttl_info.min:            []
recompression_ttl_info.max:            []
group_by_ttl_info.expression:          []
group_by_ttl_info.min:                 []
group_by_ttl_info.max:                 []
rows_where_ttl_info.expression:        []
rows_where_ttl_info.min:               []
rows_where_ttl_info.max:               []
projections:                           []
visible:                               1
creation_tid:                          (1,1,'00000000-0000-0000-0000-000000000000')
removal_tid_lock:                      0
removal_tid:                           (0,0,'00000000-0000-0000-0000-000000000000')
creation_csn:                          0
removal_csn:                           0
has_lightweight_delete:                0
last_removal_attemp_time:              1970-01-01 00:00:00
removal_state:                         Cleanup thread hasn't seen this part yet

1 row in set. Elapsed: 0.020 sec. 

References: https://clickhouse.com/docs/en/guides/developer/ttl

Was this article helpful?

Related Articles

CHISTADATA IS COMMITTED TO OPEN SOURCE SOFTWARE AND BUILDING HIGH PERFORMANCE COLUMNSTORES

In the spirit of freedom, independence and innovation. ChistaDATA Corporation is not affiliated with ClickHouse Corporation 

Need Support?

Can't find the answer you're looking for?
Contact Support

ChistaDATA Inc. Knowledge base is licensed under the Apache License, Version 2.0 (the “License”)

Copyright 2022 ChistaDATA Inc

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.