REFRESH TABLEREFRESH TABLE

使缓存条目失效,其中包含给定表或视图的数据和元数据。Invalidates the cached entries, which include data and metadata of the given table or view. 当缓存表或与之关联的查询再次执行时,将以迟缓方式填充无效缓存。The invalidated cache is populated in lazy manner when the cached table or the query associated with it is executed again.

语法Syntax

REFRESH [TABLE] table_identifier

参数Parameters

  • table_identifiertable_identifier

    表名,它是指定表或视图的限定或非限定名称。A table name, which is either a qualified or unqualified name that designates a table or view. 如果未提供任何数据库标识符,则它会引用当前数据库中的临时视图、表或视图。If no database identifier is provided, it refers to a temporary view or a table or view in the current database.

    语法: [database_name.] table_nameSyntax: [database_name.] table_name

示例Examples

-- The cached entries of the table is refreshed
-- The table is resolved from the current database as the table name is unqualified.
REFRESH TABLE tbl1;

-- The cached entries of the view is refreshed or invalidated
-- The view is resolved from tempDB database, as the view name is qualified.
REFRESH TABLE tempDB.view1;