在postgresql中解释(缓冲,分析)

在postgresql中解释(缓冲,分析),第1张

概述我是 postgresql的新手,我试着理解 explain(缓冲区,分析)指令.我有一个查询,我使用explain(buffers,analyze)执行它. 第一次执行它时性能比第二次差.此外,第一次在’hit’旁边获得’read’参数,而第二次’read’不存在. 有人可以帮我理解吗? 第一次选择,页面变热 – 它们被加载到缓存,一旦它们在RAM中 – 所有下一个选择将更快(RAM速度更高). 我是 postgresql的新手,我试着理解 explain(缓冲区,分析)指令.我有一个查询,我使用explain(buffers,analyze)执行它.

第一次执行它时性能比第二次差.此外,第一次在’hit’旁边获得’read’参数,而第二次’read’不存在.

有人可以帮我理解吗?

解决方法 第一次选择,页面变热 – 它们被加载到缓存,一旦它们在RAM中 – 所有下一个选择将更快(RAM速度更高).

因此缓冲区显示读取,当页面不在缓存中时,cos postgres读取它们,并且当它们变热时不读取,因此缓存被命中…

使用docs更新:

BUFFERS

Include information on buffer usage. Specifically,include the
number of shared blocks hit,read,dirtIEd,and written,the number of
local blocks hit,and the number of temp
blocks read and written. A hit means that a read was avoIDed because
the block was found already in cache when needed. Shared blocks
contain data from regular tables and indexes; local blocks contain
data from temporary tables and indexes; while temp blocks contain
short-term working data used in sorts,hashes,Materialize plan nodes,
and similar cases. The number of blocks dirtIEd indicates the number
of prevIoUsly unmodifIEd blocks that were changed by this query; while
the number of blocks written indicates the number of
prevIoUsly-dirtIEd blocks evicted from cache by this backend during
query processing. The number of blocks shown for an upper-level node
includes those used by all its child nodes. In text format,only
non-zero values are printed. This parameter may only be used when
ANALYZE is also enabled. It defaults to FALSE.

令人惊讶的是缓冲区here并不多.

总结

以上是内存溢出为你收集整理的在postgresql中解释(缓冲,分析)全部内容,希望文章能够帮你解决在postgresql中解释(缓冲,分析)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1160873.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存