# Trino（SQL 查询引擎）

**Trino** 是一个开源的分布式 SQL 查询引擎，用于查询分布在一个或多个异构数据源上的大型数据集。<sup>[1](https://trino.io/docs/current/overview.html)</sup> 它以 Java 编写，采用 Apache 2.0 许可，由非营利的 Trino 软件基金会（Trino Software Foundation）治理；它于 2019 年由 Presto 的原始作者主导、作为 Presto 的分叉创建，并于 2020 年 12 月 27 日由 PrestoSQL 更名为 Trino。<sup>[2](https://github.com/trinodb/trino)</sup><sup> • </sup><sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 分布式 ANSI SQL 查询引擎，在服务器集群上并行执行查询，自身不存储数据<sup>[1](https://trino.io/docs/current/overview.html)</sup><sup> • </sup><sup>[4](https://trino.io/docs/current/language.html)</sup> |
| 起源 | 2012 年由戴恩·桑德斯特伦（Dain Sundstrom）、大卫·菲利普斯（David Phillips）、马丁·特拉韦尔索（Martin Traverso）和埃里克·黄（Eric Hwang）在脸书（Facebook）创建为 Presto；2019 年分叉为 PrestoSQL；2020 年 12 月 27 日更名为 Trino<sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup> |
| 治理 | 非营利的 Trino 软件基金会（前身为 2019 年 1 月成立的 Presto 软件基金会）<sup>[5](https://trino.io/blog/2019/01/31/presto-software-foundation-launch.html)</sup> |
| 许可与代码 | Apache 2.0；GitHub 仓库 trinodb/trino，约 13.4k 星标、3.8k 分叉<sup>[2](https://github.com/trinodb/trino)</sup> |
| 版本发布 | 整数版本号，大约每一到两个月发布一次；2026 年 7 月 17 日发布 483 版，2026 年 10 月 15 日发布 484 版<sup>[6](https://trino.io/docs/current/release.html)</sup> |
| 架构 | 每个集群一个协调节点加零个或多个工作节点；每个节点在一个 JVM 实例中运行 Trino<sup>[7](https://trino.io/docs/current/overview/concepts.html)</sup> |
| 旗舰部署 | Amazon Athena 引擎版本 3 集成了 Trino 的功能<sup>[8](https://codewithsql.com/compare/trino-vs-presto)</sup> |

## 历史

该引擎于 2012 年在脸书起步。[戴恩·桑德斯特伦](https://www.edgepedia.org/zh/dain-sundstrom)、大卫·菲利普斯和[马丁·特拉韦尔索](https://www.edgepedia.org/zh/martin-traverso)当年加入脸书数据基础设施团队，与埃里克·黄一同创建了 Presto，以解决脸书庞大的 Hadoop 数据仓库上的低延迟交互式分析问题，而开源从一开始就是不可谈判的前提。<sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup> Presto 以 Apache 许可发布，并于 2013 年向公众开放开发。<sup>[5](https://trino.io/blog/2019/01/31/presto-software-foundation-launch.html)</sup>

**分叉。** 2018 年，几位原始创建者离开了脸书。据他们所述，起因是脸书决定授予一些此前没有 Presto 经验的脸书开发者提交权限，且未与社区沟通。<sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup> 他们于 2019 年 1 月成立 Presto 软件基金会，作为该项目独立、非营利的托管机构，社区也随之归拢到该基金会之下。<sup>[5](https://trino.io/blog/2019/01/31/presto-software-foundation-launch.html)</sup> 随后脸书就 Presto 这一名称申请商标，并于 2019 年 9 月在 [Linux 基金会](https://www.edgepedia.org/zh/linux-foundation)下设立 Presto 基金会，开始行使商标权。<sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup> 由于无法就不损害社区的条件达成一致，原始团队为项目改名：PrestoSQL 于 2020 年 12 月 27 日成为 Trino。<sup>[3](https://trino.io/blog/2020/12/27/announcing-trino.html)</sup> 自分叉以来，Trino 一直独立于 Presto 代码库进行开发。<sup>[9](https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-trino-intro-history.html)</sup>

## 架构与查询执行

Trino 是一个分布式查询引擎，在多台服务器上并行处理数据。<sup>[7](https://trino.io/docs/current/overview/concepts.html)</sup> 一个集群由一个协调节点和零个或多个工作节点组成；用户连接协调节点，由它解析语句、规划查询并管理工作节点，工作节点则执行计划。每个节点在一个 JVM 实例中运行 Trino，并进一步通过线程实现并行处理。在开发或测试场景下，单个实例可以同时承担这两种角色。<sup>[7](https://trino.io/docs/current/overview/concepts.html)</sup>

执行模型是分层的。一条 SQL 语句是传给 Trino 的文本；执行时它变成一次查询，其分布式计划实现为一棵由阶段（stage）构成的树。阶段在工作节点上转化为任务（task），任务作用于分片（split），即由驱动（driver）处理的数据单元。<sup>[7](https://trino.io/docs/current/overview/concepts.html)</sup>

Trino 自称是兼容 ANSI SQL 的查询引擎，这使用户能够把 BI 与 ETL 工具与任意底层数据源集成；它会对收到的 SQL 语句进行校验，并翻译为对已连接数据源的操作。<sup>[4](https://trino.io/docs/current/language.html)</sup>

## 连接器与数据源

Trino 不是数据库，而是查询引擎：它本身不持有数据，而是通过目录（catalog）执行 SQL，这些目录指向对象存储、[Apache Iceberg](https://www.edgepedia.org/zh/apache-iceberg) 与 [Delta Lake](https://www.edgepedia.org/zh/delta-lake) 之类的表格式，以及其他数据库。<sup>[8](https://codewithsql.com/compare/trino-vs-presto)</sup> 对数据源的访问通过目录配置，每个连接器把一种数据源适配到 Trino 引擎。<sup>[7](https://trino.io/docs/current/overview/concepts.html)</sup>

文档中列出的连接器覆盖了广泛的系统，包括 BigQuery、Cassandra、ClickHouse、Delta Lake、Elasticsearch、Google Sheets、Hive、Hudi、Iceberg、Kafka、MariaDB、MongoDB、MySQL、OpenSearch、Oracle、Pinot、PostgreSQL、Redis、Redshift、Snowflake 和 SQL Server，此外还有 TPC-DS、[TPC-H](https://www.edgepedia.org/zh/tpc-h) 等测试用连接器。<sup>[10](https://trino.io/docs/current/)</sup>

## 基准测试中的性能

基准测试给出的图景并不单一。在一项针对 Trino 468、Spark 4.0.0-RC2 以及运行于 MR3 2.0 之上的 Hive 4 的 TPC-DS 评测中，Trino 的平均响应时间最低：它平均每条查询耗时 17.49 秒，而 Spark 为 37.65 秒，运行于 Tez 上的 Hive 为 57.00 秒，运行于 MR3 上的 Hive 为 19.76 秒，比 Trino 慢约 13%。<sup>[11](https://mr3docs.datamonad.com/blog/2025-04-18-performance-evaluation-2.0/)</sup> 同一份报告还指出查询 23 存在一个正确性缺陷，作者将其归因于 PrestoSQL 更名为 Trino 之后的那段时期，因为 Presto 317 对该查询返回正确结果。<sup>[11](https://mr3docs.datamonad.com/blog/2025-04-18-performance-evaluation-2.0/)</sup>

单节点结果则更有利于原生引擎。2026 年发表的一项经同行评议的系统性综述与基准测试，针对 SQL-on-Hadoop 与湖仓引擎，在单节点（4 个 CPU 核心、8 个硬件线程）上以规模因子 1 和 10 运行 TPC-H，发现 DuckDB、ClickHouse、Impala 以及经 Velox 加速的 Presto 等原生或向量化引擎，相比 Spark SQL 和 Trino 等纯 JVM 技术栈，运行时间显著更低、纵向扩展效率更高，不同类别的引擎之间存在数量级差异。<sup>[12](https://www.sciencedirect.com/science/article/abs/pii/S0306437925001218)</sup>

## 生态系统与采用情况

商业与托管产品直接构建在 Trino 之上。由 Trino 创建者创办的 Starburst 在其之上销售商业产品；[Amazon Athena](https://www.edgepedia.org/zh/amazon-athena) 引擎版本 3 集成了 Trino 的功能；Athena 按扫描的数据量（TB）计费。<sup>[8](https://codewithsql.com/compare/trino-vs-presto)</sup> [腾讯云](https://www.edgepedia.org/zh/tencent-cloud)在 EMR-V3.6.0 Hadoop 集群中将 Trino 414 作为交互式 SQL 引擎组件纳入。<sup>[13](https://stackscape.org/en/p/trino/)</sup>

Trino 项目以大约每一到两个月的稳定节奏发布，每次版本号递增 1；近期版本中，480 版（2026 年 3 月）加入了带行血缘的 Iceberg v3 写入与删除，483 版（2026 年 7 月）将 PIVOT 语法和新的 Web UI 设为默认。<sup>[6](https://trino.io/docs/current/release.html)</sup><sup> • </sup><sup>[13](https://stackscape.org/en/p/trino/)</sup>

**与替代方案的定位。** 实践者文献中的比较把 Trino 定位为在交互式联邦 SQL 响应速度、容错执行和商业生态方面较强；Spark 在长时间运行的批处理 ETL 和机器学习方面更强；[StarRocks](https://www.edgepedia.org/zh/starrocks) 以自带存储和物化视图瞄准高并发、低延迟查询；DuckDB 适合单节点嵌入式分析，而 Trino 面向多用户、大规模分布式查询。<sup>[13](https://stackscape.org/en/p/trino/)</sup>

## References

1. [Overview — Trino 484 Documentation](https://trino.io/docs/current/overview.html)
2. [GitHub: trinodb/trino](https://github.com/trinodb/trino)
3. [We're rebranding PrestoSQL as Trino, Trino blog (27 December 2020)](https://trino.io/blog/2020/12/27/announcing-trino.html)
4. [SQL language — Trino 484 Documentation](https://trino.io/docs/current/language.html)
5. [Presto Software Foundation Launch, Trino blog (31 January 2019)](https://trino.io/blog/2019/01/31/presto-software-foundation-launch.html)
6. [Release notes — Trino 484 Documentation](https://trino.io/docs/current/release.html)
7. [Trino concepts — Trino 484 Documentation](https://trino.io/docs/current/overview/concepts.html)
8. [Trino vs Presto: History, Differences, Which to Use (2026), codewithsql.com](https://codewithsql.com/compare/trino-vs-presto)
9. [Trino history and design, Amazon EMR documentation](https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-trino-intro-history.html)
10. [Trino documentation](https://trino.io/docs/current/)
11. [Trino, Spark, and Hive TPC-DS Benchmark Comparison on MR3 2.0](https://mr3docs.datamonad.com/blog/2025-04-18-performance-evaluation-2.0/)
12. [Modern alternatives to Hive: a systematic review and single-node benchmark of SQL-on-Hadoop and lakehouse engines, Information Systems 136 (2026)](https://www.sciencedirect.com/science/article/abs/pii/S0306437925001218)
13. [Trino: Standard distributed SQL engine for the lakehouse, Stackscape](https://stackscape.org/en/p/trino/)

---
*Initially written Oct 26, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › SQL and query languages

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/trino-sql-query-engine

English original: https://www.edgepedia.org/trino-sql-query-engine
