-
Notifications
You must be signed in to change notification settings - Fork 0
Description
--- As of 2026-02-03T21:53:07.000Z ---
Radim Marek reported non-deterministic buffer counts in EXPLAIN ANALYZE BUFFERS output, where Sort nodes show different buffer usage between first and subsequent executions within the same session. The issue stems from catalog lookups (pg_amop/pg_amproc) during execution that get cached after first use. David Rowley argued this is expected behavior since buffer accesses should be reported, questioning why it's considered a bug. Tomas Vondra explained that execution requires additional metadata not needed during planning, suggesting tracking syscache lookups separately might help. Lukas Fittl mentioned his stack-based instrumentation patch could address this by separating different types of buffer access. David noted that moving more work to the planner would require proper plan invalidation and suggested a contrib module to prepopulate caches for testing purposes instead.
Radim Marek报告了EXPLAIN ANALYZE BUFFERS输出中的非确定性缓冲区计数问题,Sort节点在同一会话中首次执行和后续执行之间显示不同的缓冲区使用量。问题源于执行期间的目录查找(pg_amop/pg_amproc)在首次使用后被缓存。David Rowley认为这是预期行为,因为缓冲区访问应该被报告,质疑为什么这被视为bug。Tomas Vondra解释说执行需要规划期间不需要的额外元数据,建议单独跟踪syscache查找可能有帮助。Lukas Fittl提到他的基于堆栈的instrumentation补丁可以通过分离不同类型的缓冲区访问来解决这个问题。David指出将更多工作转移到规划器需要适当的计划失效处理,建议创建一个contrib模块来为测试目的预填充缓存。
participants - 参与者: