postgresql/src/backend/access/index
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
..
Makefile Revert "Rename files and headers related to index AM" 2019-12-27 08:09:00 +09:00
amapi.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
amvalidate.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
genam.c Add const to values and nulls arguments 2023-10-10 07:50:43 +02:00
indexam.c Reuse BrinDesc and BrinRevmap in brininsert 2023-11-25 20:27:28 +01:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00