知识卡片

普通读书笔记卡 · 10295.a.1.a.4.b · 生成模型:未记录

文件版本如何识别

理解等级:中级

新版本数据库经常还要读取旧数据,必须在解释新旧布局之前识别磁盘格式。可查看文件名约定或外部版本文件,也可让文件的固定头部携带版本信息,随后分派到对应的解码器。头部方案必须为识别版本保留跨代稳定的字节位置,否则读者需要先知道格式才能确定格式号。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Database Internals》Chapter 3. File Formats(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch03.html#idm46104533052456,段 129) - 结论依据:原文讨论稳定头部的必要性与按版本选择读取器,并举两种外部版本标识。 - 原始内容:The version can also be stored directly in the index file header. In this case, a part of the header (or an entire header) has to be encoded in a format that does not change between versions.