All Projects → powa-team → Pg_stat_kcache

powa-team / Pg_stat_kcache

Licence: postgresql
Gather statistics about physical disk access and CPU consumption done by backends.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Pg stat kcache

Powa Web
PoWA user interface
Stars: ✭ 66 (-37.74%)
Mutual labels:  database, postgresql, performance, optimization
Go Perfbook
Thoughts on Go performance optimization
Stars: ✭ 9,597 (+8953.77%)
Mutual labels:  performance, optimization, performance-analysis
Performance
⏱ PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.
Stars: ✭ 429 (+304.72%)
Mutual labels:  database, performance, performance-analysis
Fe Performance Journey
🚵 a Journey of Performance Optimizing in Frontend 🚀
Stars: ✭ 169 (+59.43%)
Mutual labels:  performance, optimization, performance-analysis
Pgaudit
PostgreSQL Audit Extension
Stars: ✭ 532 (+401.89%)
Mutual labels:  database, postgresql, extension
Hypopg
Hypothetical Indexes for PostgreSQL
Stars: ✭ 594 (+460.38%)
Mutual labels:  database, postgresql, extension
Awesome Wp Speed Up
Plugins and resources to speed up and optimize your WordPress site.
Stars: ✭ 375 (+253.77%)
Mutual labels:  database, performance, optimization
Pgtune
Pgtune - tuning PostgreSQL config by your hardware
Stars: ✭ 1,078 (+916.98%)
Mutual labels:  database, postgresql, performance
Pg flame
A flamegraph generator for Postgres EXPLAIN ANALYZE output.
Stars: ✭ 1,391 (+1212.26%)
Mutual labels:  database, postgresql, performance
Junitperf
⛵️Junit performance rely on junit5 and jdk8+.(java 性能测试框架)
Stars: ✭ 86 (-18.87%)
Mutual labels:  performance, performance-analysis
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+1095.28%)
Mutual labels:  database, postgresql
Jplusone
Tool for automatic detection and asserting "N+1 SELECT problem" occurences in JPA based Spring Boot Java applications and finding origin of JPA issued SQL statements in general
Stars: ✭ 91 (-14.15%)
Mutual labels:  optimization, performance-analysis
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+1092.45%)
Mutual labels:  database, postgresql
Lighthouse Batch
Run Lighthouse analysis over multiple sites in a single command
Stars: ✭ 83 (-21.7%)
Mutual labels:  performance, performance-analysis
Postguard
🐛 Statically validate Postgres SQL queries in JS / TS code and derive schemas.
Stars: ✭ 104 (-1.89%)
Mutual labels:  database, postgresql
Pg Anonymizer
Dump anonymized PostgreSQL database with a NodeJS CLI
Stars: ✭ 83 (-21.7%)
Mutual labels:  database, postgresql
Objectbox C
ObjectBox C and C++: super-fast database for objects and structs
Stars: ✭ 91 (-14.15%)
Mutual labels:  database, performance
Agent
The best way to backup and restore your database
Stars: ✭ 80 (-24.53%)
Mutual labels:  database, postgresql
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+17039.62%)
Mutual labels:  database, postgresql
Entityworker.core
EntityWorker is an object-relation mapper(ORM) that enable .NET developers to work with relations data using objects. EntityWorker is an alternative to entityframwork. is more flexible and much faster than entity framework.
Stars: ✭ 91 (-14.15%)
Mutual labels:  database, postgresql

pg_stat_kcache

Features

Gathers statistics about real reads and writes done by the filesystem layer. It is provided in the form of an extension for PostgreSQL >= 9.4., and requires pg_stat_statements extension to be installed. PostgreSQL 9.4 or more is required as previous version of provided pg_stat_statements didn't expose the queryid field.

Installation

Compiling

The module can be built using the standard PGXS infrastructure. For this to work, the pg_config program must be available in your $PATH. Instruction to install follows::

git clone https://github.com/powa-team/pg_stat_kcache.git cd pg_stat_kcache make make install

PostgreSQL setup

The extension is now available. But, as it requires some shared memory to hold its counters, the module must be loaded at PostgreSQL startup. Thus, you must add the module to shared_preload_libraries in your postgresql.conf. You need a server restart to take the change into account. As this extension depends on pg_stat_statements, it also need to be added to shared_preload_libraries.

Add the following parameters into you postgresql.conf::

postgresql.conf

shared_preload_libraries = 'pg_stat_statements,pg_stat_kcache'

Once your PostgreSQL cluster is restarted, you can install the extension in every database where you need to access the statistics::

mydb=# CREATE EXTENSION pg_stat_kcache;

Configuration

The following GUCs can be configured, in postgresql.conf:

  • pg_stat_kcache.linux_hz (int, default -1): informs pg_stat_kcache of the linux CONFIG_HZ config option. This is used by pg_stat_kcache to compensate for sampling errors. The default value is -1, tries to guess it at startup.
  • pg_stat_kcache.track (enum, default top): controls which statements are tracked by pg_stat_kcache. Specify top to track top-level statements (those issued directly by clients), all to also track nested statements (such as statements invoked within functions), or none to disable statement statistics collection.
  • pg_stat_kcache.track_planning (bool, default off): controls whether planning operations and duration are tracked by pg_stat_kcache (requires PostgreSQL 13 or above).

Usage

pg_stat_kcache create several objects.

pg_stat_kcache view

+------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Type | Description | +==================+==================+=========================================================================================================================================================+ | datname | name | Name of the database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_user_time | double precision | User CPU time used planning statements in this database, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_system_time | double precision | System CPU time used planning statements in this database, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_minflts | bigint | Number of page reclaims (soft page faults) planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_majflts | bigint | Number of page faults (hard page faults) planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nswaps | bigint | Number of swaps planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads | bigint | Number of bytes read by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads_blks | bigint | Number of 8K blocks read by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes | bigint | Number of bytes written by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes_blks | bigint | Number of 8K blocks written by the filesystem layer planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgsnds | bigint | Number of IPC messages sent planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgrcvs | bigint | Number of IPC messages received planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nsignals | bigint | Number of signals received planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nvcsws | bigint | Number of voluntary context switches planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nivcsws | bigint | Number of involuntary context switches planning statements in this database (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_user_time | double precision | User CPU time used executing statements in this database, in seconds and milliseconds | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_system_time | double precision | System CPU time used executing statements in this database, in seconds and milliseconds | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_minflts | bigint | Number of page reclaims (soft page faults) executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_majflts | bigint | Number of page faults (hard page faults) executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nswaps | bigint | Number of swaps executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads | bigint | Number of bytes read by the filesystem layer executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads_blks | bigint | Number of 8K blocks read by the filesystem layer executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes | bigint | Number of bytes written by the filesystem layer executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes_blks | bigint | Number of 8K blocks written by the filesystem layer executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgsnds | bigint | Number of IPC messages sent executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgrcvs | bigint | Number of IPC messages received executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nsignals | bigint | Number of signals received executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nvcsws | bigint | Number of voluntary context switches executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nivcsws | bigint | Number of involuntary context switches executing statements in this database | +------------------+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+

pg_stat_kcache_detail view

+------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Type | Description | +==================+==================+==========================================================================================================================================+ | query | text | Query text | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | top | bool | True if the statement is top-level | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | datname | name | Database name | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | rolname | name | Role name | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_user_time | double precision | User CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_system_time | double precision | System CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_minflts | bigint | Number of page reclaims (soft page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_majflts | bigint | Number of page faults (hard page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nswaps | bigint | Number of swaps planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads | bigint | Number of bytes read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads_blks | bigint | Number of 8K blocks read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes | bigint | Number of bytes written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes_blks | bigint | Number of 8K blocks written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgsnds | bigint | Number of IPC messages sent planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgrcvs | bigint | Number of IPC messages received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nsignals | bigint | Number of signals received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nvcsws | bigint | Number of voluntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nivcsws | bigint | Number of involuntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_user_time | double precision | User CPU time used executing the statement, in seconds and milliseconds | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_system_time | double precision | System CPU time used executing the statement, in seconds and milliseconds | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_minflts | bigint | Number of page reclaims (soft page faults) executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_majflts | bigint | Number of page faults (hard page faults) executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nswaps | bigint | Number of swaps executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads | bigint | Number of bytes read by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads_blks | bigint | Number of 8K blocks read by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes | bigint | Number of bytes written by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes_blks | bigint | Number of 8K blocks written by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgsnds | bigint | Number of IPC messages sent executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgrcvs | bigint | Number of IPC messages received executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nsignals | bigint | Number of signals received executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nvcsws | bigint | Number of voluntary context switches executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nivcsws | bigint | Number of involuntary context switches executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+

pg_stat_kcache_reset function

Resets the statistics gathered by pg_stat_kcache. Can be called by superusers::

pg_stat_kcache_reset()

pg_stat_kcache function

This function is a set-returning functions that dumps the containt of the counters of the shared memory structure. This function is used by the pg_stat_kcache view. The function can be called by any user::

SELECT * FROM pg_stat_kcache();

It provides the following columns:

+------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Type | Description | +==================+==================+==========================================================================================================================================+ | queryid | bigint | pg_stat_statements' query identifier | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | top | bool | True if the statement is top-level | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | userid | oid | Database OID | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | dbid | oid | Database OID | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_user_time | double precision | User CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_system_time | double precision | System CPU time used planning the statement, in seconds and milliseconds (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_minflts | bigint | Number of page reclaims (soft page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_majflts | bigint | Number of page faults (hard page faults) planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nswaps | bigint | Number of swaps planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads | bigint | Number of bytes read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_reads_blks | bigint | Number of 8K blocks read by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes | bigint | Number of bytes written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_writes_blks | bigint | Number of 8K blocks written by the filesystem layer planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgsnds | bigint | Number of IPC messages sent planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_msgrcvs | bigint | Number of IPC messages received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nsignals | bigint | Number of signals received planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nvcsws | bigint | Number of voluntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | plan_nivcsws | bigint | Number of involuntary context switches planning the statement (if pg_stat_kcache.track_planning is enabled, otherwise zero) | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_user_time | double precision | User CPU time used executing the statement, in seconds and milliseconds | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_system_time | double precision | System CPU time used executing the statement, in seconds and milliseconds | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_minflts | bigint | Number of page reclaims (soft page faults) executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_majflts | bigint | Number of page faults (hard page faults) executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nswaps | bigint | Number of swaps executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads | bigint | Number of bytes read by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_reads_blks | bigint | Number of 8K blocks read by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes | bigint | Number of bytes written by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_writes_blks | bigint | Number of 8K blocks written by the filesystem layer executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgsnds | bigint | Number of IPC messages sent executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_msgrcvs | bigint | Number of IPC messages received executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nsignals | bigint | Number of signals received executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nvcsws | bigint | Number of voluntary context switches executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+ | exec_nivcsws | bigint | Number of involuntary context switches executing the statements | +------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------+

Updating the extension

Note that a PostgreSQL restart is required for changes other than than SQL objects. Most of the new code will be enabled as soon as the restart is done, whether or not the extension is updated, as the extension only takes care of exposing the internal data structure in SQL.

Please also note that when the set-returning function fields are changes, a PostgreSQL restart is required to load the new version of the extension. Until the restart is done, updating the extension will fail with messages similar to:

could not find function "pg_stat_kcache_2_2" in file .../pg_stat_kcache.so

Bugs and limitations

No known bugs.

Tracking planner resources usage requires PostgreSQL 13 or above.

We assume that a kernel block is 512 bytes. This is true for Linux, but may not be the case for another Unix implementation.

See: http://lkml.indiana.edu/hypermail/linux/kernel/0703.2/0937.html

On platforms without a native getrusage(2), all fields except user_time and system_time will be NULL.

On platforms with a native getrusage(2), some of the fields may not be maintained. This is a platform dependent behavior, please refer to your platform getrusage(2) manual page for more details.

If pg_stat_kcache.track is all, pg_stat_kcache tracks nested statements. The max number of nesting level that will be tracked is is limited to 64, in order to keep implementation simple, but this should be enough for reasonable use cases.

Even if pg_stat_kcache.track is all, pg_stat_kcache view considers only statistics of top-level statements. So, there is the case which even though user cpu time used planning a nested statement is high, plan_user_time of pg_stat_kcache view is small. In such a case, user cpu time used planning a nested statement is counted in exec_user_time.

Authors

pg_stat_kcache is an original development from Thomas Reiss, with large portions of code inspired from pg_stat_plans. Julien Rouhaud also contributed some parts of the extension.

Thanks goes to Peter Geoghegan for providing much inspiration with pg_stat_plans so we could write this extension quite straightforward.

License

pg_stat_kcache is free software distributed under the PostgreSQL license.

Copyright (c) 2014-2017, Dalibo Copyright (c) 2018-2020, The PoWA-team

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].