刷新表
描述
REFRESH TABLE
语句会使给定表或视图的缓存条目(包括数据和元数据)失效。失效的缓存会在缓存表或与其关联的查询再次执行时,以惰性方式填充。
语法
REFRESH [TABLE] table_identifier
参数
-
表标识符
指定一个表名,该表名可以是限定名或非限定名,用于指定表/视图。如果未提供数据库标识符,则它指代当前数据库中的临时视图或表/视图。
语法:
[ 数据库名. ] 表名
示例
-- The cached entries of the table will be refreshed
-- The table is resolved from the current database as the table name is unqualified.
REFRESH TABLE tbl1;
-- The cached entries of the view will be refreshed or invalidated
-- The view is resolved from tempDB database, as the view name is qualified.
REFRESH TABLE tempDB.view1;