postgresql/src/include
Fujii Masao 78ebda66bf Speed up truncation of temporary relations.
Previously, truncating a temporary relation required scanning the entire
local buffer pool once per relation fork to invalidate buffers. This could
be slow, especially with a large local buffers, as the scan was repeated
multiple times.

A similar issue with regular tables (shared buffers) was addressed in
commit 6d05086c0a by scanning the buffer pool only once for all forks.

This commit applies the same optimization to temporary relations,
improving truncation performance.

Author: Daniil Davydov <3danissimo@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Maxim Orlov <orlovmg@gmail.com>
Discussion: https://postgr.es/m/CAJDiXggNqsJOH7C5co4jA8nDk8vw-=sokyh5s1_TENWnC6Ofcg@mail.gmail.com
2025-07-04 09:03:58 +09:00
..
access Remove leftover dead code from commit_ts.h. 2025-07-03 23:39:45 +09:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
catalog Fix typo in pg_publication.h. 2025-07-01 15:17:03 +05:30
commands Support multi-line headers in COPY FROM command. 2025-07-03 15:27:26 +09:00
common Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
fe_utils Remove inappropriate inclusions of c.h and postgres_fe.h. 2025-04-27 16:58:57 -04:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Don't use double-quotes in #include's of system headers, redux. 2025-04-27 13:23:19 -04:00
lib Use PRI?64 instead of "ll?" in format strings (continued). 2025-03-29 10:43:57 +01:00
libpq Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
mb With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
nodes Refactor subtype field of AlterDomainStmt 2025-07-03 16:34:28 +09:00
optimizer Fix some new issues with planning of PlaceHolderVars. 2025-06-29 15:04:32 -04:00
parser Revert support for improved tracking of nested queries 2025-06-12 10:08:55 +09:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
port Remove implicit cast from 'void *' 2025-07-02 11:51:10 +07:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Add missing PGDLLIMPORT markings 2025-04-11 08:59:52 +02:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Fix re-distributing previously distributed invalidation messages during logical decoding. 2025-06-16 17:36:01 -07:00
rewrite Refactor ChangeVarNodesExtended() using the custom callback 2025-05-07 11:10:16 +03:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Stats: use schemaname/relname instead of regclass. 2025-03-25 11:16:06 -07:00
storage Speed up truncation of temporary relations. 2025-07-04 09:03:58 +09:00
tcop Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Break out xxx2yyy_opt_overflow APIs for more datetime conversions. 2025-07-03 16:17:08 -04:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Enable MSVC conforming preprocessor 2025-07-01 09:41:40 +02:00
fmgr.h Avoid mixing designated and non-designated field initializers. 2025-03-27 11:06:30 -04:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
miscadmin.h Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
pg_config.h.in Make our usage of memset_s() conform strictly to the C11 standard. 2025-05-18 12:45:55 -04:00
pg_config_manual.h Avoid invalidating all RelationSyncCache entries on publication rename. 2025-03-13 09:16:33 +05:30
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h pgstat: Allow checksum errors to be reported in critical sections 2025-03-30 16:12:04 -04:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Add timingsafe_bcmp(), for constant-time memory comparison 2025-04-02 15:32:40 +03:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h libpq: Deprecate pg_int64. 2025-03-25 21:40:00 +13:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00