# 一张大表

**一张大表（OBT）**是一种面向分析的数据建模方法，它将事实及其维度属性扁平化到一张宽大的反规范化表中，使针对该表的查询完全不需要连接操作。客户名称、产品类别、门店区域、日期描述等维度属性直接内联存储在事件或度量数据的每一行上，而不是保存在单独的维度表中并在查询时进行连接。<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup><sup> • </sup><sup>[2](https://dataarchitect.studio/essays/one-big-table-vs-star-schema/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 一张宽大的反规范化表，包含特定分析用例所需的大部分或全部字段，事实与维度被扁平化在一起<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup> |
| 别称 | 宽表、超级表、反规范化数据集市、物化扁平视图<sup>[3](https://www.ssp.sh/brain/one-big-table)</sup> |
| 核心权衡 | 以数据冗余和维度变更时的写入端重建为代价，换取查询时零连接<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup><sup> • </sup><sup>[4](https://www.thedataengineering.com/mechanisms/data-modeling/how-it-works/binding-styles/one-big-table)</sup> |
| 最适合 | 仅按1至3个维度过滤的工作负载，如物联网数据、日志系统和单一用例应用<sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup> |
| 最不适合 | OLTP工作负载、频繁的小量更新，以及需要严格治理和可复用模型的环境<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup> |
| 建议放置位置 | 构建在星型模式之上的服务层，而非星型模式的替代品<sup>[6](https://datatechbridge-projects.github.io/data-architecture-field-guide/05-dimensional-modeling-cloud-era/04-beyond-star-schemas/)</sup><sup> • </sup><sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup> |
| 在Power BI中的地位 | 星型模式是Power BI的首选模型；OBT主要适用于一次性分析或原型设计<sup>[7](https://tabulareditor.com/blog/data-model-types-examples-and-tips-for-power-bi-part-2)</sup> |

## 理念

OBT抛弃了维度建模的核心分离原则。在经典的星型模式中，一张由数值度量构成的中心事实表被上下文维度表所环绕，查询运行时通过代理键将两者连接起来。<sup>[2](https://dataarchitect.studio/essays/one-big-table-vs-star-schema/)</sup><sup> • </sup><sup>[8](https://www.kimballgroup.com/2003/01/fact-tables-and-dimension-tables/)</sup>而在OBT中，这一连接在管道中只执行一次，结果存储为一张表：每条订单行已经携带了它的客户名称、产品类别、门店区域和日期属性。<sup>[2](https://dataarchitect.studio/essays/one-big-table-vs-star-schema/)</sup>在从完全规范化的第三范式设计到完全反规范化的光谱上，OBT位于反规范化的极端。<sup>[9](https://datadef.io/blog/data-modeling-best-practices)</sup>

[拉尔夫·金博尔](https://www.edgepedia.org/zh/ralph-kimball)（Ralph Kimball）是金博尔集团的创始人，也是《数据仓库工具箱》（*The Data Warehouse Toolkit*）的作者，他将事实-维度分离描述为将世界划分为度量和上下文：数值事实被文本上下文所环绕，如产品、门店、时间和客户。他指出，你*可以*将所有上下文合并为每个事实一条宽记录，但将其划分为维度通常更为方便，并能防止单一的组合维度变得臃肿难用。<sup>[8](https://www.kimballgroup.com/2003/01/fact-tables-and-dimension-tables/)</sup>OBT本质上就是他描述过但否决了的设计。<sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>

## 起源

这个术语没有单一的起源点。其编年史作者找到的最早出现时间在2021年和2022年，一个可能的推动因素是谷歌早期对BigQuery的指导——当时BigQuery的连接能力有限；据报道，一个谷歌团队建议将所有数据反规范化到一张大表中，而非构建传统的事实-维度仓库。<sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>技术本身比名称更古老：由物化视图、宽表和快照表构建的数据集市几十年来一直服务于相同的目的。<sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>

## 为什么可能更快

现代云数据仓库使用大规模并行处理（MPP）和物理列式存储，默认针对历史聚合进行了优化。<sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup>由于OBT不需要连接，它避免了连接引起的数据混洗，而在连接代价高昂但列扫描廉价的引擎上，扁平表通常能更快地返回结果。<sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup><sup> • </sup><sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>实践者指南中反复出现两个实用阈值：当常见连接的两侧都超过约10吉字节时，考虑使用OBT；而当对宽表进行过滤所用的维度超过两到三个时，聚类将不再有帮助。<sup>[10](https://blog.dataengineer.io/p/how-to-data-model-correctly-kimball)</sup><sup> • </sup><sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup>

列式编码缓解了存储成本。游程编码和字典编码压缩了OBT散布在每一行上的重复维度值，因此原始存储代价比行式存储要小，尽管冗余仍然会扩大扫描量和计算费用。<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup>

## 代价

**变更时重建。**当维度属性发生变化时，携带该属性的每一行事实数据都必须重写。举例来说，重命名一个产品类别影响200个产品；如果每个产品出现在500万条订单行中，那就是200×5,000,000，即10亿个重复存储值需要更新。<sup>[4](https://www.thedataengineering.com/mechanisms/data-modeling/how-it-works/binding-styles/one-big-table)</sup>同样的算术适用于修正一个产品类别标签错误——而在星型模式中，只需更新维度表中的一行即可。<sup>[6](https://datatechbridge-projects.github.io/data-architecture-field-guide/05-dimensional-modeling-cloud-era/04-beyond-star-schemas/)</sup>

**缓慢变化维度。**直接在OBT中处理时间点历史是别扭的：完整历史意味着每个实体对应多条宽行，这会增大表的体积并提高查询复杂度。值也被冻结在构建时使用的约定下，通常是“当时值”，因此若想按当前层级重新表述，就意味着重建整张表。<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup><sup> • </sup><sup>[4](https://www.thedataengineering.com/mechanisms/data-modeling/how-it-works/binding-styles/one-big-table)</sup>

**治理与血缘。**没有明确的事实和一致性维度，“客户”或“区域”等定义可能在表之间悄然漂移。为每个仪表板或用例各建一张OBT的团队，最终会在十几张宽表中计算同一个度量，而这些表在悄悄分化。<sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup><sup> • </sup><sup>[2](https://dataarchitect.studio/essays/one-big-table-vs-star-schema/)</sup>将敏感数据集中在一处也提高了隐私要求：随着表越来越宽、查询用户越来越多，细粒度访问控制、数据脱敏和匿名化变得愈发难以管理。<sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup>

**一个有用的结构视角**是：OBT是一张忘记了自己是物化视图的物化视图。相对于管理良好的物化视图，它丢弃的是刷新策略、依赖跟踪和过期契约——即声明数据可以有多旧的约定；大多数OBT的失败可归因于这三种机制的缺失，而非宽度本身。<sup>[4](https://www.thedataengineering.com/mechanisms/data-modeling/how-it-works/binding-styles/one-big-table)</sup>

## 适用场景

当过滤维度少且稳定时，OBT效果良好。在物联网数据中，分析人员通常只按事件时间戳和传感器类型过滤，下游分析在此基础上构建，即使单条传感器行携带数百个属性也是如此；在那种场景下，按维度建模数百个属性不值得费那个劲。<sup>[5](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)</sup>日志系统和单一用例应用具有相同的形态。它对于一次性分析和原型设计，以及不支持关系的BI工具来说也很方便。<sup>[7](https://tabulareditor.com/blog/data-model-types-examples-and-tips-for-power-bi-part-2)</sup><sup> • </sup><sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>

相比之下，Power BI的指南建议从星型模式开始，仅在需求确实不匹配时才偏离；使用星型模式进行过滤和查询可能比一张大表更快，而在源系统中构建的OBT更难复用于其他场景。<sup>[7](https://tabulareditor.com/blog/data-model-types-examples-and-tips-for-power-bi-part-2)</sup>在建模光谱的另一端，OBT提供了架构简洁性和快速读取性能，但随着业务及其问题集的增长，其扩展性不佳。<sup>[11](https://www.getdbt.com/blog/modeling-success-dbt)</sup>

大多数实践者来源所趋同的模式是分层而非替代：先构建并统一事实和维度模型，然后从中物化出OBT或宽表，作为反规范化的预连接投影，服务于特定的高流量仪表板、语义层数据源或需要无连接读取的机器学习特征集。<sup>[6](https://datatechbridge-projects.github.io/data-architecture-field-guide/05-dimensional-modeling-cloud-era/04-beyond-star-schemas/)</sup><sup> • </sup><sup>[1](https://www.ml4devs.com/what-is/one-big-table/)</sup>以这种方式构建，OBT从底层的维度模型继承了一致的维度处理，包括缓慢变化维度逻辑。<sup>[3](https://www.ssp.sh/brain/one-big-table)</sup>

## 相关的单表方法

OBT并非唯一的单表设计。[活动模式](https://www.edgepedia.org/zh/activity-schema)（activity schema）将数据建模为一位客户在一张约11列、不含JSON的时间序列表中随时间执行活动，通过过滤该表而非连接事实和维度来回答数据问题。<sup>[12](https://www.getdbt.com/blog/activity-schema-data-modeling-with-a-single-table)</sup>这一区别很重要，因为OBT的宽度是无界的，而结构化单表设计则预先固定了模式。

## References

1. [One Big Table (OBT): When to Use It and How, ml4devs](https://www.ml4devs.com/what-is/one-big-table/)
2. [One Big Table vs the Star Schema: The Real Trade-off, dataarchitect.studio](https://dataarchitect.studio/essays/one-big-table-vs-star-schema/)
3. [One Big Table (OBT), SSP Brain (Simon Späti)](https://www.ssp.sh/brain/one-big-table)
4. [One Big Table, The Data Engineering (binding styles)](https://www.thedataengineering.com/mechanisms/data-modeling/how-it-works/binding-styles/one-big-table)
5. [One Big Table (OBT) Approach, Data Developer & Engineer](https://ddeutils.github.io/ddedocs/abstract/data_management/data_modeling/dwh-obt-approach/)
6. [Beyond Star Schemas: One Big Table & Wide Tables, Data Architecture Field Guide](https://datatechbridge-projects.github.io/data-architecture-field-guide/05-dimensional-modeling-cloud-era/04-beyond-star-schemas/)
7. [Data model types, examples, and tips for Power BI (Part 2), Tabular Editor](https://tabulareditor.com/blog/data-model-types-examples-and-tips-for-power-bi-part-2)
8. [Fact Tables and Dimension Tables, Kimball Group (Ralph Kimball, 2003)](https://www.kimballgroup.com/2003/01/fact-tables-and-dimension-tables/)
9. [Data Modeling Best Practices for Analytics, Datadef](https://datadef.io/blog/data-modeling-best-practices)
10. [How to data model correctly: Kimball vs One Big Table, Data Engineer.io](https://blog.dataengineer.io/p/how-to-data-model-correctly-kimball)
11. [Modeling for success: Building data structures that last, dbt Labs](https://www.getdbt.com/blog/modeling-success-dbt)
12. [Introducing the activity schema: data modeling with a single table, dbt Labs](https://www.getdbt.com/blog/activity-schema-data-modeling-with-a-single-table)

---
*Initially written Oct 26, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Database theory and data modeling › Database normalization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/one-big-table

English original: https://www.edgepedia.org/one-big-table
