{"Entry":{"collection":"metric","key":"pg_stat_xact_all_tables-n_tup_ins","name":"pg_stat_xact_all_tables.n_tup_ins","aliases":["n_tup_ins","pg_stat_xact_all_tables"],"metadata":{"aliases":["n_tup_ins","pg_stat_xact_all_tables"],"category":"pg_stat_xact_all_tables","content_hash":"e61828bcba42ab23281c6f473a8f9aa84b8be9f7c129f9678b6a052e3513cba8","derived_content_hash":"176cbc42a47409dd8443affbcac64a116cf42dfb5cb3b0b34ae6bb472c4e61cf","imported_at":"2026-09-30T00:40:46.56758+08:00","name":"pg_stat_xact_all_tables.n_tup_ins","name_zh":"","slug":"pg_stat_xact_all_tables-n_tup_ins","summary":"Source-defined field pg_stat_xact_all_tables.n_tup_ins. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below."}},"Definition":{"Collection":"metric","Key":"pg_stat_xact_all_tables-n_tup_ins","SourceDatabase":"center","Version":"18","SourceTable":"statistics_metric","SourceKey":"pg_stat_xact_all_tables-n_tup_ins","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"field":"n_tup_ins","source_expression":"pg_stat_get_xact_tuples_inserted(C.oid)","source_view":"pg_stat_xact_all_tables","view":"pg_stat_xact_all_tables","view_definition":"CREATE VIEW pg_stat_xact_all_tables AS\nSELECT\n            C.oid AS relid,\n            N.nspname AS schemaname,\n            C.relname AS relname,\n            pg_stat_get_xact_numscans(C.oid) AS seq_scan,\n            pg_stat_get_xact_tuples_returned(C.oid) AS seq_tup_read,\n            sum(pg_stat_get_xact_numscans(I.indexrelid))::bigint AS idx_scan,\n            sum(pg_stat_get_xact_tuples_fetched(I.indexrelid))::bigint +\n            pg_stat_get_xact_tuples_fetched(C.oid) AS idx_tup_fetch,\n            pg_stat_get_xact_tuples_inserted(C.oid) AS n_tup_ins,\n            pg_stat_get_xact_tuples_updated(C.oid) AS n_tup_upd,\n            pg_stat_get_xact_tuples_deleted(C.oid) AS n_tup_del,\n            pg_stat_get_xact_tuples_hot_updated(C.oid) AS n_tup_hot_upd,\n            pg_stat_get_xact_tuples_newpage_updated(C.oid) AS n_tup_newpage_upd\n    FROM pg_class C LEFT JOIN\n         pg_index I ON C.oid = I.indrelid\n         LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)\n    WHERE C.relkind IN ('r', 't', 'm', 'p')\n    GROUP BY C.oid, N.nspname, C.relname;"},"comparison_hash":"60fa5cc9234778439be1252722c3603072a5056aeed69e3be8e89ba447bb4e84","description":["Source-defined field pg_stat_xact_all_tables.n_tup_ins. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below."],"description_zh":"pg_stat_xact_all_tables.n_tup_ins 统计字段。","description_zh_html":"\u003cp\u003epg_stat_xact_all_tables.n_tup_ins 统计字段。\u003c/p\u003e\u003cdl\u003e\u003cdt\u003e视图\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003epg_stat_xact_all_tables\u003c/code\u003e\u003c/dd\u003e\u003cdt\u003e字段\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003en_tup_ins\u003c/code\u003e\u003c/dd\u003e\u003c/dl\u003e\u003cp\u003e该字段由本版本 \u003ccode\u003esystem_views.sql\u003c/code\u003e 中的事务局部统计视图定义；以下为源码表达式，未把它解释成全局累计统计或运行测量。\u003c/p\u003e\u003cpre\u003e\u003ccode\u003epg_stat_get_xact_tuples_inserted(C.oid)\u003c/code\u003e\u003c/pre\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cp\u003e\n\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 的\u003cem class=\"firstterm\"\u003e累积统计系统\u003c/em\u003e支持收集和报告有关服务器活动的信息。目前，对表和索引的访问会按磁盘块和行两种口径计数。每个表中的总行数，以及每个表的清理和分析操作的信息也被计数。如果启用，对用户定义函数的调用和每个函数中花费的总时间也会被计数。\n\u003c/p\u003e\u003cp\u003e\n\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 也支持报告关于系统当前正在发生的情况的动态信息，例如其他服务器进程当前正在执行的确切命令，以及系统中存在哪些其他连接。此功能独立于累积统计系统。\n\u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/monitoring-stats.html#id-1.6.14.7.6.8.2.2.14.1.2\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","documented":false,"facts":[{"label":"View","value":"pg_stat_xact_all_tables"},{"label":"Field","value":"n_tup_ins"},{"label":"Field evidence","value":"Source declaration; not individually enumerated by the manual"},{"label":"Expression declared in","value":"pg_stat_xact_all_tables"}],"facts_zh":[{"label":"视图","value":"pg_stat_xact_all_tables"},{"label":"字段","value":"n_tup_ins"},{"label":"字段证据","value":"源码声明；手册未逐列列举。"},{"label":"表达式声明位置","value":"pg_stat_xact_all_tables"}],"field":"n_tup_ins","manual_html":"","manual_path":"/docs/18/monitoring-stats.html","related":[{"label":"pg_stat_xact_all_tables columns","url":"/wiki/catalog/pg_stat_xact_all_tables/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[{"paragraphs":["Similar to pg_stat_all_tables, but counts actions taken so far within the current transaction (which are not yet included in pg_stat_all_tables and related views). The columns for numbers of live and dead rows and vacuum and analyze actions are not present in this view."],"title":"View semantics"},{"paragraphs":["A transaction can also see its own statistics (not yet flushed out to the shared memory statistics) in the views pg_stat_xact_all_tables , pg_stat_xact_sys_tables , pg_stat_xact_user_tables , and pg_stat_xact_user_functions . These numbers do not act as stated above; instead they update continuously throughout the transaction."],"title":"Collection and transaction context"},{"code":"pg_stat_get_xact_tuples_inserted(C.oid)","paragraphs":["No per-field definition, effective SQL type, unit, or reset rule is inferred from this expression."],"title":"Exact source expression"},{"code":"CREATE VIEW pg_stat_xact_all_tables AS\nSELECT\n            C.oid AS relid,\n            N.nspname AS schemaname,\n            C.relname AS relname,\n            pg_stat_get_xact_numscans(C.oid) AS seq_scan,\n            pg_stat_get_xact_tuples_returned(C.oid) AS seq_tup_read,\n            sum(pg_stat_get_xact_numscans(I.indexrelid))::bigint AS idx_scan,\n            sum(pg_stat_get_xact_tuples_fetched(I.indexrelid))::bigint +\n            pg_stat_get_xact_tuples_fetched(C.oid) AS idx_tup_fetch,\n            pg_stat_get_xact_tuples_inserted(C.oid) AS n_tup_ins,\n            pg_stat_get_xact_tuples_updated(C.oid) AS n_tup_upd,\n            pg_stat_get_xact_tuples_deleted(C.oid) AS n_tup_del,\n            pg_stat_get_xact_tuples_hot_updated(C.oid) AS n_tup_hot_upd,\n            pg_stat_get_xact_tuples_newpage_updated(C.oid) AS n_tup_newpage_upd\n    FROM pg_class C LEFT JOIN\n         pg_index I ON C.oid = I.indrelid\n         LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)\n    WHERE C.relkind IN ('r', 't', 'm', 'p')\n    GROUP BY C.oid, N.nspname, C.relname;","paragraphs":[],"title":"Complete source view definition"}],"sections_zh":[{"paragraphs":["类似于 pg_stat_all_tables，但统计当前事务截至目前发生的操作（尚未计入 pg_stat_all_tables 及相关视图）。此视图不包含活行数、死行数以及清理和分析操作相关的列。"],"title":"视图语义"},{"paragraphs":["事务还可以在视图 pg_stat_xact_all_tables 、 pg_stat_xact_sys_tables 、 pg_stat_xact_user_tables 和 pg_stat_xact_user_functions 中看到自己的统计信息（尚未刷新到共享内存统计信息）。这些数字不像上面所述那样起作用；相反，它们在事务期间持续更新。"],"title":"采集与事务语义"},{"code":"pg_stat_get_xact_tuples_inserted(C.oid)","paragraphs":["不根据此表达式推断各字段的定义、实际 SQL 类型、单位或重置规则。"],"title":"源码中的原始表达式"},{"code":"CREATE VIEW pg_stat_xact_all_tables AS\nSELECT\n            C.oid AS relid,\n            N.nspname AS schemaname,\n            C.relname AS relname,\n            pg_stat_get_xact_numscans(C.oid) AS seq_scan,\n            pg_stat_get_xact_tuples_returned(C.oid) AS seq_tup_read,\n            sum(pg_stat_get_xact_numscans(I.indexrelid))::bigint AS idx_scan,\n            sum(pg_stat_get_xact_tuples_fetched(I.indexrelid))::bigint +\n            pg_stat_get_xact_tuples_fetched(C.oid) AS idx_tup_fetch,\n            pg_stat_get_xact_tuples_inserted(C.oid) AS n_tup_ins,\n            pg_stat_get_xact_tuples_updated(C.oid) AS n_tup_upd,\n            pg_stat_get_xact_tuples_deleted(C.oid) AS n_tup_del,\n            pg_stat_get_xact_tuples_hot_updated(C.oid) AS n_tup_hot_upd,\n            pg_stat_get_xact_tuples_newpage_updated(C.oid) AS n_tup_newpage_upd\n    FROM pg_class C LEFT JOIN\n         pg_index I ON C.oid = I.indrelid\n         LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)\n    WHERE C.relkind IN ('r', 't', 'm', 'p')\n    GROUP BY C.oid, N.nspname, C.relname;","paragraphs":[],"title":"源码中的完整视图定义"}],"signature":"SELECT n_tup_ins FROM pg_catalog.pg_stat_xact_all_tables;","source_expression":"pg_stat_get_xact_tuples_inserted(C.oid)","source_only":true,"source_view":"pg_stat_xact_all_tables","sources":[{"label":"PostgreSQL 18 English manual","path":"monitoring-stats.html","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","url":"/docs/18/monitoring-stats.html#id-1.6.14.7.6.8.2.2.14.1.2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"18.6 source archive · src/backend/catalog/system_views.sql","path":"src/backend/catalog/system_views.sql","sha256":"418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"sql_type":"","tables":[],"tables_zh":[],"units_mentioned":[],"view":"pg_stat_xact_all_tables","zh_from":{"authored_translation":"source-derived-structured-summary","body_sha256":"94a0847f2fd92058b502f2381dcbf1d020f6264971bf1a916dfc821bd759725f","kind":"same-version-chinese-manual-with-source-derived-structured-summary","manual":{"anchor":"id-1.6.14.7.6.8.2.2.14.1.2","build_id":107,"extraction":"concept-introduction","fragment_sha256":"1be9bd443fc95b9609f883e0865ad0835fb5d2c2cc7b0d5e87a84e4aae73ffcb","locale":"zh-Hans","page_key":"monitoring-stats.html","source_hash":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/monitoring-stats.html#id-1.6.14.7.6.8.2.2.14.1.2","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/monitoring-stats.html","release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"PostgreSQL 18 English manual","path":"monitoring-stats.html","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","url":"/docs/18/monitoring-stats.html#id-1.6.14.7.6.8.2.2.14.1.2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"18.6 source archive · src/backend/catalog/system_views.sql","path":"src/backend/catalog/system_views.sql","sha256":"418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"MeasuredEvidence":{}},"Text":{"Collection":"metric","Key":"pg_stat_xact_all_tables-n_tup_ins","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_stat_xact_all_tables.n_tup_ins","Summary":"Source-defined field pg_stat_xact_all_tables.n_tup_ins. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below.","BodyHTML":"\u003cp\u003eSource-defined field pg_stat_xact_all_tables.n_tup_ins. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"b42d77e6afa970b2dcb18de8edb54d5113fcdcef23f9e5323cce971e79708ef1","Payload":{"description":["Source-defined field pg_stat_xact_all_tables.n_tup_ins. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below."],"manual_html":"","related":[{"label":"pg_stat_xact_all_tables columns","url":"/wiki/catalog/pg_stat_xact_all_tables/?v=18"}],"sections":[{"paragraphs":["Similar to pg_stat_all_tables, but counts actions taken so far within the current transaction (which are not yet included in pg_stat_all_tables and related views). The columns for numbers of live and dead rows and vacuum and analyze actions are not present in this view."],"title":"View semantics"},{"paragraphs":["A transaction can also see its own statistics (not yet flushed out to the shared memory statistics) in the views pg_stat_xact_all_tables , pg_stat_xact_sys_tables , pg_stat_xact_user_tables , and pg_stat_xact_user_functions . These numbers do not act as stated above; instead they update continuously throughout the transaction."],"title":"Collection and transaction context"},{"code":"pg_stat_get_xact_tuples_inserted(C.oid)","paragraphs":["No per-field definition, effective SQL type, unit, or reset rule is inferred from this expression."],"title":"Exact source expression"},{"code":"CREATE VIEW pg_stat_xact_all_tables AS\nSELECT\n            C.oid AS relid,\n            N.nspname AS schemaname,\n            C.relname AS relname,\n            pg_stat_get_xact_numscans(C.oid) AS seq_scan,\n            pg_stat_get_xact_tuples_returned(C.oid) AS seq_tup_read,\n            sum(pg_stat_get_xact_numscans(I.indexrelid))::bigint AS idx_scan,\n            sum(pg_stat_get_xact_tuples_fetched(I.indexrelid))::bigint +\n            pg_stat_get_xact_tuples_fetched(C.oid) AS idx_tup_fetch,\n            pg_stat_get_xact_tuples_inserted(C.oid) AS n_tup_ins,\n            pg_stat_get_xact_tuples_updated(C.oid) AS n_tup_upd,\n            pg_stat_get_xact_tuples_deleted(C.oid) AS n_tup_del,\n            pg_stat_get_xact_tuples_hot_updated(C.oid) AS n_tup_hot_upd,\n            pg_stat_get_xact_tuples_newpage_updated(C.oid) AS n_tup_newpage_upd\n    FROM pg_class C LEFT JOIN\n         pg_index I ON C.oid = I.indrelid\n         LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)\n    WHERE C.relkind IN ('r', 't', 'm', 'p')\n    GROUP BY C.oid, N.nspname, C.relname;","paragraphs":[],"title":"Complete source view definition"}],"tables":[]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
