跳到主要内容
版本: 最新版本-3.5

DROP DICTIONARY

删除字典对象或清除字典对象中的缓存数据。

语法

DROP DICTIONARY <dictionary_object_name> [ CACHE ]

参数

  • dictionary_object_name:字典对象的名称。
  • CACHE:如果指定关键字 CACHE,则只会清除字典对象中的缓存数据。 要稍后恢复缓存数据,您可以手动刷新它。 如果未指定关键字 CACHE,则会删除字典对象。

示例

  • 示例 1:仅清除字典对象中的缓存数据。
DROP DICTIONARY dict_obj CACHE;

字典对象仍然存在。

MySQL > SHOW DICTIONARY dict_obj\G
*************************** 1. row ***************************
DictionaryId: 5
DictionaryName: dict_obj
DbName: example_db
dictionaryObject: dict
dictionaryKeys: [order_uuid]
dictionaryValues: [order_id_int]
status: UNINITIALIZED
lastSuccessRefreshTime: 2024-05-24 12:59:10
lastSuccessFinishedTime: 2024-05-24 12:59:20
nextSchedulableTime: disable auto schedule for refreshing
ErrorMessage:
approximated dictionaryMemoryUsage (Bytes): 172.26.80.55:8060 : 0
172.26.80.56:8060 : 0
172.26.80.57:8060 : 0
1 row in set (0.00 sec)
  • 示例 2:删除字典对象 dict_obj
DROP DICTIONARY dict_obj;

字典对象已完全删除,不再存在。

MySQL > SHOW DICTIONARY dict_obj;
Empty set (0.00 sec)