1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00
Michael Paquier e65c331b8f Add new pgstats routine to split pending data setup
This commit adds pgstat_prep_pending_from_entry_ref(), a new pgstats
routine that is able to prepare an existing PgStat_EntryRef to receive
pending stats.  This split gives a way for callers to obtain first a
reference via pgstat_get_entry_ref(), then set up pending data as two
separate, distinctive, steps.

Previously, the only way to get an entry reference with pending data
ready was pgstat_prep_pending_entry(), which bundles lookup, creation,
and pending setup in a single call.  Callers that need finer control
over the entry creation had no way to attach pending data to an
already-obtained entry reference.  One case where this has shown to
matter for a stats kind is where one wants to check some capacity (for
example where a GUC bounds the maximum numer of entries allowed) before
deciding if a new entry should be created.  So this split can help in
reducing calls to pgstat_get_entry_ref(), meaning less shmem hash table
lookups.

The only logical ordering change is that pgStatPendingContext is
initialized after calling pgstat_get_entry_ref() in
pgstat_prep_pending_entry().  This does not matter in practice.

pgstat_prep_pending_entry() is refactored to use the new function
internally.  All the existing callers are unchanged.  Existing
out-of-core custom stats kinds should see no impact.

Author: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAA5RZ0sV+TsLejUMhAM=PJoOm8u-t8ru7B67KvyLCy=19sM87g@mail.gmail.com
2026-07-22 08:15:00 +09:00
2026-07-17 11:48:35 -04:00
2026-07-21 15:32:56 +02:00
2022-12-04 15:23:00 -05:00
2024-11-05 13:56:02 +01:00
2026-07-16 12:03:05 +02:00
2026-01-01 13:24:10 -05:00
2020-02-10 20:47:50 +01:00
2026-02-23 13:34:22 -05:00

PostgreSQL Database Management System

This directory contains the source code distribution of the PostgreSQL database management system.

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.

Copyright and license information can be found in the file COPYRIGHT.

General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.

The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.

Description
Зеркало официального репозитория PostgreSQL GIT
Readme 1.3 GiB
Languages
C 83.9%
PLpgSQL 6.2%
Perl 5.4%
Yacc 1.2%
Meson 0.7%
Other 2.4%