postgresql/src/backend/access
Tomas Vondra c1ec02be1d Reuse BrinDesc and BrinRevmap in brininsert
The brininsert code used to initialize (and destroy) BrinDesc and
BrinRevmap for each tuple, which is not free. This patch initializes
these structures only once, and reuses them for all inserts in the same
command. The data is passed through indexInfo->ii_AmCache.

This also introduces an optional AM callback "aminsertcleanup" that
allows performing custom cleanup in case simply pfree-ing ii_AmCache is
not sufficient (which is the case when the cache contains TupleDesc,
Buffers, and so on).

Author: Soumyadeep Chakraborty
Reviewed-by: Alvaro Herrera, Matthias van de Meent, Tomas Vondra
Discussion: https://postgr.es/m/CAE-ML%2B9r2%3DaO1wwji1sBN9gvPz2xRAtFUGfnffpd0ZqyuzjamA%40mail.gmail.com
2023-11-25 20:27:28 +01:00
..
brin Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
common Make ResourceOwners more easily extensible. 2023-11-08 13:30:50 +02:00
gin Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
gist Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
hash Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
heap Release lock on heap buffer before vacuuming FSM 2023-11-17 12:46:55 -08:00
index Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
nbtree Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
rmgrdesc During online checkpoints, insert XLOG_CHECKPOINT_REDO at redo point. 2023-10-19 14:47:29 -04:00
spgist Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
table Add const to values and nulls arguments 2023-10-10 07:50:43 +02:00
tablesample Update copyright for 2023 2023-01-02 15:00:37 -05:00
transam C comment: clarify that WAL files can be _recycled_ or removed 2023-11-25 10:48:18 -05:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00