PG性能采集分析工具之PoWA介绍

0    243    2

Tags:

👉 本文共约18234个字,系统预计阅读时间或需69分钟。

简介

PoWA--PostgreSQL 负载分析工具

本文主要介绍 PG 的一个性能采集和分析工具 PoWA 的部署方法和使用特点,该工具利用 PG 的扩展插件实现,其性能诊断分析能力比较接近 ORACLE AWR 报表功能。

PoWA是PostgreSQL 9.4及以后更新版本的性能工具,允许从各种Stats Extensions收集、聚合和清除多个 PostgreSQL 实例的统计信息,全称为PostgreSQL工作负载分析器(PostgreSQL Workload Analyzer)。

PoWA组成部分如下:

  1. PoWA-archivist是PostgreSQL的插件,收集其他插件获取到的性能统计数据。PoWA-archivist是PoWA的核心组件。其主要有如下2个部分:
    • 名为“powa”的管理功能扩展。
    • 名为“powa”的模块,可以选择作为后台工作程序运行,用以收集本地实例上的性能数据。
  2. PoWA-collector是在专用存储库服务器上,用于收集远程PostgreSQL实例性能指标的守护进程。
  3. PoWA-web是PoWA-collector收集到的性能指标的用户展示界面。
  4. 其它插件:安装于目标PostgreSQL数据库实例上的其他插件,其是性能指标数据的实际来源。
  5. PoWA:整个系统的总称。

除了pg_stat_statements、btree_gist、powa为必须的插件,PoWA还支持以下几个插件作为新能指标采集的扩展

  1. pg_qualstats:用于保存在WHERE语句和JOIN子句中发现的谓词的统计信息,powa 利用它来提供索引建议。

  2. pg_stat_kcache:收集有关文件系统层的实际读取和写入的统计信息,可以用于观察SQL花费多少cpu等。

  3. pg_wait_sampling:用于收集等待事件的采样统计信息,启用后它会收集如下两种统计信息:

    • 历史等待事件。它被实现为内存中的环形缓冲区,其中每个进程等待事件的样本都以给定的(可配置的)周期写入。因此,对于每个正在运行的进程,用户可以根据历史大小(可配置)查看一些最近的样本。假设有一个客户端定期读取此历史记录并将其转储到某个地方,则用户可以拥有连续的历史记录。

    • 等待分析,以内存hash表形式存在,表中存放每个进程和每个等待事件累积的样本,该表可以根据用户请求进行reset。假设有一个客户端定期转储并reset,用户可以统计一段时间内等待事件的详细。

  4. pg_track_settings:该插件提供了一个可定期调用的函数(pg_tracksettingssnapshot())。 在每次调用时,它将存储自上次调用以来更改的设置。

  5. Hypopg:类似MySQL虚拟索引。

  6. pg_stat_statements:用于SQL语句监控。

一些连接

文档:https://powa.readthedocs.io/en/latest/

GitHub地址:https://github.com/powa-team

https://github.com/powa-team/powa-archivist

https://github.com/powa-team/powa-web

cpu, io消耗监控
https://github.com/powa-team/pg_stat_kcache

where条件过滤性统计
https://github.com/powa-team/pg_qualstats

官网提供了一个公网的例子,可以在线查看。

部署架构简介

PoWA 4.0 之后的部署架构支持本地部署和远程部署。推荐用远程部署方式,部署架构图如下。

在每个 PG 实例里启用插件,在独立的服务器上部署采集程序 PoWA collector 和主程序 PoWA web。
上面架构图用到的插件简介如下:

  • pg_stat_statements :记录指定 PG 实例上所有 SQL 的统计信息,具体数据在视图 pg_stat_statements 上。
  • pg_qualstats :采集 SQL 语句的 wherejoin 语句中的条件的统计信息。
  • pg_stat_kcache :采集主机系统指标的统计信息。
  • pg_wait_sampling :采集 SQL 语句的等待事件,并提供等待事件的汇总统计视图。
  • pg_track_settings :主要是跟踪实例的参数配置变化。

在生产环境中,我们要做的是竟可能避免单个PG的powa库中的数据量过大。但是我们又要存放一段时间的快照信息用于性能分析,这个类似于Oracle的AWR快照信息。

这个时候我们就需要专门创建一个单独的powa数据库用于存储各个pg采集过来的数据。所以生产环境中我们基本上采取的远程模式部署powa。

远程模式示意图

数据库级性能指标

General Overview

图1 General Overview
点击放大

字段中文解释英文解释
Queries per sec每秒执行查询的次数。Number of time the query has been executed,per second
Runtime per sec每秒内执行查询的总耗时。Total duration of queries executed,per second
Avg runtime查询的平均耗时。Average query duration
字段中文解释英文解释
Total shared buffers hit命中共享缓冲区的数据量。Amount of data found in shared buffers
Total shared buffers miss未命中共享缓冲区的数据量。Amount of data found in OS cache or read from disk。

Database Objects

图2 Database Objects
点击放大

字段中文解释英文解释
Index scans ratio索引扫描/序列扫描的比率。Ratio of index scan / seq scan
Index scans每秒索引扫描次数。Number of index scan per second
Sequential scans每秒顺序扫描次数。Number of sequential scan per second
字段中文解释英文解释
Tuples inserted每秒插入的行数。Number of tuples inserted per second
Tuples updated每秒更新的行数。Number of tuples updated per second
Tuples HOT updated每秒更新(HOT)的行数。Number of tuples HOT updated per second
Tuples deleted每秒删除的行数。Number of tuples deleted per second
字段中文解释英文解释
# Vacuum每秒手动清理的次数。Number of vacuum per second
# Autovacuum每秒自动清理的次数。Number of autovacuum per second
# Analyze每秒手动分析的次数。Number of analyze per second
# Autoanalyze每秒自动分析的次数。Number of autoanalyze per second

Details for all databases

图3 Details for all databases
点击放大

字段注释
Query执行的SQL。
(Execution) #执行该SQL次数。
(Execution) Time执行该SQL总时间。
(Execution) Avg time执行该SQL平均时间。
(I/O Time) Read读I/O等待时间。
(I/O Time) Write写I/O等待时间。
(Blocks) Read磁盘读页面数。
(Blocks) Hit共享缓冲区命中页面数。
(Blocks) Dirtied脏页面数。
(Blocks) Written磁盘写页面数。
(Temp blocks) Read磁盘读临时页面数。
(Temp blocks) Write磁盘写临时页面数。

实例级性能指标

General Overview

图1 General Overview性能指标
点击放大

字段中文解释英文解释
Queries per sec每秒执行查询的次数。Number of time the query has been executed, per second
Runtime per sec每秒执行的查询的总持续时间。Total duration of queries executed, per second
Avg runtime平均查询时长。Average query duration
字段中文解释英文解释
Total hit在共享缓冲区中找到的数据量。Amount of data found in shared buffers
Total read在操作系统缓存中找到或从磁盘读取的数据量。Amount of data found in OS cache or read from disk

Background Writer

图2 Background Writer性能指标
点击放大

字段中文解释英文解释
of requested checkpoints已执行的请求检查点数。Number of requested checkpoints that have been performed
of scheduled checkpoints已执行的预定检查点数。Number of scheduled checkpoints that have been performed
字段中文解释英文解释
Buffers alloc分配的缓冲区数。Number of buffers allocated
Sync time文件同步到磁盘的检查点处理部分所花费的总时间(单位 : 毫秒)。Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds
Write time在将文件写入磁盘的检查点处理部分中花费的总时间(单位 : 毫秒)。Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds
字段中文解释英文解释
Maxwritten clean后台编写器因写入过多缓冲区而停止清理扫描的次数。Number of times the background writer stopped a cleaning scan because it had written too many buffers
Buffers clean后台写入器写入的缓冲区数。Number of buffers written by the background writer
字段中文解释英文解释
Buffers backend fsync后端必须执行自己的 fsync 调用的次数。Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)
Buffers backend后端直接写入的缓冲区数。Number of buffers written directly by a backend

Database Objects

图3 Database Objects性能指标
点击放大

字段中文解释英文解释
Index scans ratio索引扫描/序列扫描的比率。Ratio of index scan / seq scan
Index scans每秒索引扫描次数。Number of index scan per second
Sequential scans每秒顺序扫描次数。Number of sequential scan per second
字段中文解释英文解释
Tuples inserted每秒插入的行数。Number of tuples inserted per second
Tuples updated每秒更新的行数。Number of tuples updated per second
Tuples HOT updated每秒更新(HOT)。Number of tuples HOT updated per second
Tuples deleted每秒删除的行数。Number of tuples deleted per second
字段中文解释英文解释
# Vacuum每秒手动清理的次数。Number of vacuum per second
# Autovacuum每秒自动清理的次数。Number of autovacuum per second
# Analyze每秒手动分析的次数。Number of analyze per second
# Autoanalyze每秒自动分析的次数。Number of autoanalyze per second

Details for all databases

图4 Details for all databases性能指标
点击放大

字段注释
Database数据库名称。
#Calls执行SQL总数。
Runtime执行SQL总耗时。
Avg runtime执行SQL平均耗时。
Blocks read磁盘读取的页面数。
Blocks hit共享缓冲区命中的页面数。
Blocks dirtied脏页数。
Blocks written磁盘写页面数。
Temp Blocks written磁盘写临时页面数。
I/O timeI/O等待时间。

PoWA archivlist 部署介绍

参考:https://powa.readthedocs.io/en/latest/quickstart.html

简介
PoWA-archivlist 是 PoWA 项目的重要组件之一,它包含 2 个元素:

  • 扩展 powa ,包含一些管理用的函数。

  • 模块 powa ,可选,在后台运行,采集本地实例的性能。

安装方法:
建议使用 PGDG 软件源里的安装包安装。rpm包下载:https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64/

在目标 PG 实例里创建数据库 powa 和相应的扩展。

也可以用下面方式自动创建依赖的扩展。

修改 PG 配置文件
安装完成后修改 postgresql.conf 里预加载的模块参数,需要重启 PG 实例才可以加载模块。

并且增加相应的参数控制记录不同 SQL 查询的个数(默认是1000,太少了)。

重启 PostgreSQL 实例,让配置生效。

查看使用示例

如果需要本地信息收集,PoWA-archivist可作为后台进程去收集。但是对应的library需要在参数文件中配置且重启生效。

pg_qualstats 部署介绍

https://github.com/powa-team/pg_qualstats

简介
pg_qualstats 主要是采集 SQL 语句的 wherejoin 语句中的条件的统计信息,帮助 DBA 分析下面问题:

使用这个列查询的语句集合是哪些?

  • where 语句里常用的查询条件的值是哪些?
  • where 语句里常用的查询条件是哪些?

安装方式

在目标 PG 实例的数据库 powa 创建相应的扩展。

修改 PG 配置文件。
安装完成后修改 postgresql.conf 里预加载的模块参数,需要重启 PG 实例才可以加载模块。

下面是插件相关的参数,也在 postgresql.conf 里添加。

pg_stat_kcache 部署介绍

简介
pg_stat_kcache :采集主机系统指标的统计信息。这个扩展可以帮助 DBA 查看每个查询、用户或数据库消耗的主机资源。主机资源包括:

  • CPU (user time 和 system time)

  • 物理磁盘访问读写次数

安装方式

在目标 PG 实例的数据库 powa 创建相应的扩展

修改 PG 配置文件。
安装完成后修改 postgresql.conf 里预加载的模块参数,需要重启 PG 实例才可以加载模块。

pg_stat_kcache 采集的记录数跟插件 pg_stat_statements 的参数保持一致。
重启实例后在 powa 库中执行下面语句:

配置

可以在 postgresql.conf 中配置以下 GUC:

  • pg_stat_kcache.linux_hz (int, default -1): 通知 pg_stat_kcache linux CONFIG_HZ 配置选项。 pg_stat_kcache 使用它来补偿采样错误。默认值为-1,尝试在启动时猜测它。
  • pg_stat_kcache.track (enum, default top): 控制哪些语句被 pg_stat_kcache 跟踪。指定 top 以跟踪顶级语句(由客户端直接发出的语句), all 也跟踪嵌套语句(例如在函数中调用的语句),或 none 以禁用语句统计收集。
  • pg_stat_kcache.track_planning (bool, default off): 控制pg_stat_kcache是否跟踪计划操作和持续时间(需要PostgreSQL 13或更高版本)。

用法

扩展pg_stat_kcache 创建几个对象。

视图pg_stat_kcache

NameTypeDescription
datnamenameName of the database
plan_user_timedouble precisionUser CPU time used planning statements in this database, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)在此数据库中计划语句使用的用户 CPU 时间,以秒和毫秒为单位(如果启用 pg_stat_kcache.track_planning,否则为零)
plan_system_timedouble precisionSystem CPU time used planning statements in this database, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中计划语句使用的系统 CPU 时间,以秒和毫秒为单位(如果启用 pg_stat_kcache.track_planning,否则为零)
plan_minfltsbigintNumber of page reclaims (soft page faults) planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中的页面回收(软页面错误)计划语句数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_majfltsbigintNumber of page faults (hard page faults) planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中的页面错误(硬页面错误)计划语句数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_nswapsbigintNumber of swaps planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中的交换计划语句数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_readsbigintNumber of bytes read by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中文件系统层规划语句读取的字节数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_reads_blksbigintNumber of 8K blocks read by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中文件系统层规划语句读取的 8K 块数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_writesbigintNumber of bytes written by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中文件系统层规划语句写入的字节数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_writes_blksbigintNumber of 8K blocks written by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中文件系统层规划语句读取的 8K 块数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_msgsndsbigintNumber of IPC messages sent planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中发送计划语句的 IPC 消息数(如果启用 pg_stat_kcache.track_planning,否则为零)
plan_msgrcvsbigintNumber of IPC messages received planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)在这个数据库中接收到计划语句的 IPC 消息数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_nsignalsbigintNumber of signals received planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)在此数据库中接收到规划语句的信号数(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_nvcswsbigintNumber of voluntary context switches planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中自愿上下文切换计划语句的数量(如果启用了 pg_stat_kcache.track_planning,否则为零)
plan_nivcswsbigintNumber of involuntary context switches planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero)此数据库中非自愿上下文切换计划语句的数量(如果启用了 pg_stat_kcache.track_planning,否则为零)
exec_user_timedouble precisionUser CPU time used executing statements in this database, in seconds and milliseconds 用户在此数据库中执行语句所使用的 CPU 时间,以秒和毫秒为单位
exec_system_timedouble precisionSystem CPU time used executing statements in this database, in seconds and milliseconds 在此数据库中执行语句所使用的系统 CPU 时间,以秒和毫秒为单位
exec_minfltsbigintNumber of page reclaims (soft page faults) executing statements in this database 在此数据库中执行语句的页面回收(软页面错误)数
exec_majfltsbigintNumber of page faults (hard page faults) executing statements in this database此数据库中执行语句的页错误(硬页错误)数
exec_nswapsbigintNumber of swaps executing statements in this database 此数据库中执行语句的交换数
exec_readsbigintNumber of bytes read by the filesystem layer executing statements in this database 文件系统层在此数据库中执行语句读取的字节数
exec_reads_blksbigintNumber of 8K blocks read by the filesystem layer executing statements in this database 文件系统层在此数据库中执行语句读取的 8K 块数
exec_writesbigintNumber of bytes written by the filesystem layer executing statements in this database 文件系统层在此数据库中执行语句写入的字节数
exec_writes_blksbigintNumber of 8K blocks written by the filesystem layer executing statements in this database 该数据库中文件系统层执行语句写入的 8K 块数
exec_msgsndsbigintNumber of IPC messages sent executing statements in this database 在此数据库中执行语句发送的 IPC 消息数
exec_msgrcvsbigintNumber of IPC messages received executing statements in this database在此数据库中执行语句接收到的 IPC 消息数
exec_nsignalsbigintNumber of signals received executing statements in this database在此数据库中执行语句接收到的信号数
exec_nvcswsbigintNumber of voluntary context switches executing statements in this database在此数据库中执行语句的自愿上下文切换数
exec_nivcswsbigintNumber of involuntary context switches executing statements in this database 在此数据库中执行语句的非自愿上下文切换数

视图pg_stat_kcache_detail

NameTypeDescription
querytextQuery text
topboolTrue if the statement is top-level
datnamenameDatabase name
rolnamenameRole name
plan_user_timedouble precisionUser CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_system_timedouble precisionSystem CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_minfltsbigintNumber of page reclaims (soft page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_majfltsbigintNumber of page faults (hard page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nswapsbigintNumber of swaps planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_readsbigintNumber of bytes read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_reads_blksbigintNumber of 8K blocks read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_writesbigintNumber of bytes written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_writes_blksbigintNumber of 8K blocks written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_msgsndsbigintNumber of IPC messages sent planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_msgrcvsbigintNumber of IPC messages received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nsignalsbigintNumber of signals received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nvcswsbigintNumber of voluntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nivcswsbigintNumber of involuntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
exec_user_timedouble precisionUser CPU time used executing the statement, in seconds and milliseconds
exec_system_timedouble precisionSystem CPU time used executing the statement, in seconds and milliseconds
exec_minfltsbigintNumber of page reclaims (soft page faults) executing the statements
exec_majfltsbigintNumber of page faults (hard page faults) executing the statements
exec_nswapsbigintNumber of swaps executing the statements
exec_readsbigintNumber of bytes read by the filesystem layer executing the statements
exec_reads_blksbigintNumber of 8K blocks read by the filesystem layer executing the statements
exec_writesbigintNumber of bytes written by the filesystem layer executing the statements
exec_writes_blksbigintNumber of 8K blocks written by the filesystem layer executing the statements
exec_msgsndsbigintNumber of IPC messages sent executing the statements
exec_msgrcvsbigintNumber of IPC messages received executing the statements
exec_nsignalsbigintNumber of signals received executing the statements
exec_nvcswsbigintNumber of voluntary context switches executing the statements
exec_nivcswsbigintNumber of involuntary context switches executing the statements

函数pg_stat_kcache_reset

重置 pg_stat_kcache 收集的统计信息。可以由超级用户调用:

函数pg_stat_kcache function

此函数是一个集合返回函数,它转储共享内存结构的计数器的包含。该函数由 pg_stat_kcache 视图使用。任何用户都可以调用该函数:

它提供了以下列:

NameTypeDescription
queryidbigintpg_stat_statements’ query identifier
topboolTrue if the statement is top-level
useridoidDatabase OID
dbidoidDatabase OID
plan_user_timedouble precisionUser CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_system_timedouble precisionSystem CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_minfltsbigintNumber of page reclaims (soft page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_majfltsbigintNumber of page faults (hard page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nswapsbigintNumber of swaps planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_readsbigintNumber of bytes read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_reads_blksbigintNumber of 8K blocks read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_writesbigintNumber of bytes written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_writes_blksbigintNumber of 8K blocks written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_msgsndsbigintNumber of IPC messages sent planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_msgrcvsbigintNumber of IPC messages received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nsignalsbigintNumber of signals received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nvcswsbigintNumber of voluntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
plan_nivcswsbigintNumber of involuntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero)
exec_user_timedouble precisionUser CPU time used executing the statement, in seconds and milliseconds
exec_system_timedouble precisionSystem CPU time used executing the statement, in seconds and milliseconds
exec_minfltsbigintNumber of page reclaims (soft page faults) executing the statements
exec_majfltsbigintNumber of page faults (hard page faults) executing the statements
exec_nswapsbigintNumber of swaps executing the statements
exec_readsbigintNumber of bytes read by the filesystem layer executing the statements
exec_reads_blksbigintNumber of 8K blocks read by the filesystem layer executing the statements
exec_writesbigintNumber of bytes written by the filesystem layer executing the statements
exec_writes_blksbigintNumber of 8K blocks written by the filesystem layer executing the statements
exec_msgsndsbigintNumber of IPC messages sent executing the statements
exec_msgrcvsbigintNumber of IPC messages received executing the statements
exec_nsignalsbigintNumber of signals received executing the statements
exec_nvcswsbigintNumber of voluntary context switches executing the statements
exec_nivcswsbigintNumber of involuntary context switches executing the statements

更新扩展

请注意,除了 SQL 对象之外的更改需要重新启动 PostgreSQL。大多数新代码将在重启完成后立即启用,无论扩展是否更新,因为扩展只负责在 SQL 中公开内部数据结构。

另请注意,当 set-returning 函数字段发生更改时,需要重新启动 PostgreSQL 才能加载新版本的扩展。在重新启动完成之前,更新扩展程序将失败,并显示类似于以下内容的消息:

在文件 …/pg_stat_kcache.so 中找不到函数“pg_stat_kcache_2_2”

BUG 和限制

没有已知的BUG。

跟踪规划器资源使用情况需要 PostgreSQL 13 或更高版本。

我们假设一个内核块是 512 字节。这对于 Linux 来说是正确的,但对于另一个 Unix 实现可能不是这样。

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复