slug: /zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict machine_translated: true machine_translated_rev: 72537a2d527c63c07aa5d2361a8829f3895cf2bd sidebar_position: 40

sidebar_label: “\u914D\u7F6E\u5916\u90E8\u5B57\u5178”

配置外部字典 {#dicts-external-dicts-dict}

如果使用xml文件配置字典,则比字典配置具有以下结构:

  1. <dictionary>
  2. <name>dict_name</name>
  3. <structure>
  4. <!-- Complex key configuration -->
  5. </structure>
  6. <source>
  7. <!-- Source configuration -->
  8. </source>
  9. <layout>
  10. <!-- Memory layout configuration -->
  11. </layout>
  12. <lifetime>
  13. <!-- Lifetime of dictionary in memory -->
  14. </lifetime>
  15. </dictionary>

相应的 DDL-查询 具有以下结构:

  1. CREATE DICTIONARY dict_name
  2. (
  3. ... -- attributes
  4. )
  5. PRIMARY KEY ... -- complex or single key configuration
  6. SOURCE(...) -- Source configuration
  7. LAYOUT(...) -- Memory layout configuration
  8. LIFETIME(...) -- Lifetime of dictionary in memory
  • name – The identifier that can be used to access the dictionary. Use the characters [a-zA-Z0-9_\-].
  • 来源 — Source of the dictionary.
  • 布局 — Dictionary layout in memory.
  • 结构 — Structure of the dictionary . A key and attributes that can be retrieved by this key.
  • 使用寿命 — Frequency of dictionary updates.

原始文章