Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1d79ce0

Browse files
michail-nikolaevCommitfest Bot
authored and
Commitfest Bot
committed
Add STIR access method and flags related to auxiliary indexes
This patch provides infrastructure for following enhancements to concurrent index builds by: - ii_Auxiliary in IndexInfo: indicates that an index is an auxiliary index used during concurrent index build - validate_index in IndexVacuumInfo: set if index_bulk_delete called during the validation phase of concurrent index build - STIR(Short-Term Index Replacement) access method is introduced, intended solely for short-lived, auxiliary usage STIR functions designed as an ephemeral helper during concurrent index builds, temporarily storing TIDs without providing the full features of a typical access method. As such, it raises warnings or errors when accessed outside its specialized usage path. Planned to be used in following commits.
1 parent 365bf48 commit 1d79ce0

File tree

23 files changed

+777
-18
lines changed

23 files changed

+777
-18
lines changed

contrib/pgstattuple/pgstattuple.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
285285
case SPGIST_AM_OID:
286286
err = "spgist index";
287287
break;
288+
case STIR_AM_OID:
289+
err = "stir index";
290+
break;
288291
case BRIN_AM_OID:
289292
err = "brin index";
290293
break;

src/backend/access/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ top_builddir = ../../..
99
include $(top_builddir)/src/Makefile.global
1010

1111
SUBDIRS = brin common gin gist hash heap index nbtree rmgrdesc spgist \
12-
sequence table tablesample transam
12+
stir sequence table tablesample transam
1313

1414
include $(top_srcdir)/src/backend/common.mk

src/backend/access/heap/vacuumlazy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,6 +3097,7 @@ lazy_vacuum_one_index(Relation indrel, IndexBulkDeleteResult *istat,
30973097
ivinfo.message_level = DEBUG2;
30983098
ivinfo.num_heap_tuples = reltuples;
30993099
ivinfo.strategy = vacrel->bstrategy;
3100+
ivinfo.validate_index = false;
31003101

31013102
/*
31023103
* Update error traceback information.
@@ -3148,6 +3149,7 @@ lazy_cleanup_one_index(Relation indrel, IndexBulkDeleteResult *istat,
31483149

31493150
ivinfo.num_heap_tuples = reltuples;
31503151
ivinfo.strategy = vacrel->bstrategy;
3152+
ivinfo.validate_index = false;
31513153

31523154
/*
31533155
* Update error traceback information.

src/backend/access/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ subdir('nbtree')
1111
subdir('rmgrdesc')
1212
subdir('sequence')
1313
subdir('spgist')
14+
subdir('stir')
1415
subdir('table')
1516
subdir('tablesample')
1617
subdir('transam')

src/backend/access/stir/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#-------------------------------------------------------------------------
2+
#
3+
# Makefile--
4+
# Makefile for access/stir
5+
#
6+
# IDENTIFICATION
7+
# src/backend/access/stir/Makefile
8+
#
9+
#-------------------------------------------------------------------------
10+
11+
subdir = src/backend/access/stir
12+
top_builddir = ../../../..
13+
include $(top_builddir)/src/Makefile.global
14+
15+
OBJS = \
16+
stir.o
17+
18+
include $(top_srcdir)/src/backend/common.mk

src/backend/access/stir/meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025, PostgreSQL Global Development Group
2+
3+
backend_sources += files(
4+
'stir.c',
5+
)

0 commit comments

Comments
 (0)