postgresql/contrib/bloom
Tom Lane 86d911ec0f Allow index AMs to cache data across aminsert calls within a SQL command.
It's always been possible for index AMs to cache data across successive
amgettuple calls within a single SQL command: the IndexScanDesc.opaque
field is meant for precisely that.  However, no comparable facility
exists for amortizing setup work across successive aminsert calls.
This patch adds such a feature and teaches GIN, GIST, and BRIN to use it
to amortize catalog lookups they'd previously been doing on every call.
(The other standard index AMs keep everything they need in the relcache,
so there's little to improve there.)

For GIN, the overall improvement in a statement that inserts many rows
can be as much as 10%, though it seems a bit less for the other two.
In addition, this makes a really significant difference in runtime
for CLOBBER_CACHE_ALWAYS tests, since in those builds the repeated
catalog lookups are vastly more expensive.

The reason this has been hard up to now is that the aminsert function is
not passed any useful place to cache per-statement data.  What I chose to
do is to add suitable fields to struct IndexInfo and pass that to aminsert.
That's not widening the index AM API very much because IndexInfo is already
within the ken of ambuild; in fact, by passing the same info to aminsert
as to ambuild, this is really removing an inconsistency in the AM API.

Discussion: https://postgr.es/m/27568.1486508680@sss.pgh.pa.us
2017-02-09 11:52:12 -05:00
..
expected Fix contrib/bloom to work for unlogged indexes. 2016-05-24 21:04:35 -04:00
sql Fix contrib/bloom to work for unlogged indexes. 2016-05-24 21:04:35 -04:00
t Finish pgindent run for 9.6: Perl files. 2016-06-12 04:19:56 -04:00
.gitignore Bloom index contrib module 2016-04-01 16:42:24 +03:00
blcost.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
blinsert.c Allow index AMs to cache data across aminsert calls within a SQL command. 2017-02-09 11:52:12 -05:00
bloom--1.0.sql Minor fixes in contrib installation scripts. 2016-06-14 10:47:06 -04:00
bloom.control Bloom index contrib module 2016-04-01 16:42:24 +03:00
bloom.h Allow index AMs to cache data across aminsert calls within a SQL command. 2017-02-09 11:52:12 -05:00
blscan.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
blutils.c Extend index AM API for parallel index scans. 2017-01-24 16:42:58 -05:00
blvacuum.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
blvalidate.c Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
Makefile Bloom index contrib module 2016-04-01 16:42:24 +03:00