---
id: 20260310-T0-01
title: "PostgreSQL 18 将支持无生产数据查询计划"
title_en: "PostgreSQL 18 to Support Query Planning Without Production Data"
url: https://ai.daily.yangsir.net/daily/20260310-T0-01
issue_date: 2026-03-10
publish_date: 2026-03-09T15:05:15.000Z
source_name: "Simon Willison"
source_url: https://simonwillison.net/2026/Mar/9/production-query-plans-without-production-data/#atom-everything
---

# PostgreSQL 18 将支持无生产数据查询计划

PostgreSQL 18 将新增 pg_restore_relation_stats() 和 pg_restore_attribute_stats() 函数。这两个函数允许数据库在不访问生产数据的情况下生成查询计划，帮助优化器决定最佳执行策略。新功能将于 2025 年 9 月发布，可降低生产环境访问风险。开发者可在开发阶段使用此功能验证查询性能。

## English Version

**PostgreSQL 18 to Support Query Planning Without Production Data**

PostgreSQL 18 will add pg_restore_relation_stats() and pg_restore_attribute_stats() functions. These allow generating query plans without accessing production data, helping the optimizer decide execution strategies. The feature, launching September 2025, reduces production access risks. Developers can use it to verify query performance during development.

---

**来源**：[Simon Willison](https://simonwillison.net/2026/Mar/9/production-query-plans-without-production-data/#atom-everything)

**详情页**：https://ai.daily.yangsir.net/daily/20260310-T0-01

---

*智语观潮 · Daily — https://ai.daily.yangsir.net/llms.txt*