📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

FUSE_TAG



Returns the snapshot tags of a table. For more information about snapshot tags, see Snapshot Tags.

Syntax

FUSE_TAG('<database_name>', '<table_name>')

Output Columns

ColumnTypeDescription
nameSTRINGTag name
snapshot_locationSTRINGSnapshot file the tag points to
expire_atTIMESTAMP (nullable)Expiration timestamp; set when RETAIN is used in CREATE SNAPSHOT TAG

Examples

SET enable_experimental_table_ref = 1; CREATE TABLE mytable(a INT, b INT); INSERT INTO mytable VALUES(1, 1),(2, 2); -- Create a snapshot tag ALTER TABLE mytable CREATE TAG v1; INSERT INTO mytable VALUES(3, 3); -- Create another tag with expiration ALTER TABLE mytable CREATE TAG temp RETAIN 2 DAYS; SELECT * FROM FUSE_TAG('default', 'mytable'); --- | name | snapshot_location | expire_at | |------|------------------------------------------------------------|----------------------------| | v1 | 1/319/_ss/a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4_v4.mpk | NULL | | temp | 1/319/_ss/f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3_v4.mpk | 2025-06-15 10:30:00.000000 |

Was this page helpful?