aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/indexam.sgml17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml
index 30eda37afa8..f107c43d6a6 100644
--- a/doc/src/sgml/indexam.sgml
+++ b/doc/src/sgml/indexam.sgml
@@ -139,6 +139,7 @@ typedef struct IndexAmRoutine
ambuild_function ambuild;
ambuildempty_function ambuildempty;
aminsert_function aminsert;
+ aminsertcleanup_function aminsertcleanup;
ambulkdelete_function ambulkdelete;
amvacuumcleanup_function amvacuumcleanup;
amcanreturn_function amcanreturn; /* can be NULL */
@@ -359,7 +360,21 @@ aminsert (Relation indexRelation,
within an SQL statement, it can allocate space
in <literal>indexInfo-&gt;ii_Context</literal> and store a pointer to the
data in <literal>indexInfo-&gt;ii_AmCache</literal> (which will be NULL
- initially).
+ initially). After the index insertions complete, the memory will be freed
+ automatically. If additional cleanup is required (e.g. if the cache contains
+ buffers and tuple descriptors), the AM may define an optional function
+ <literal>indexinsertcleanup</literal>, called before the memory is released.
+ </para>
+
+ <para>
+<programlisting>
+void
+aminsertcleanup (IndexInfo *indexInfo);
+</programlisting>
+ Clean up state that was maintained across successive inserts in
+ <literal>indexInfo-&gt;ii_AmCache</literal>. This is useful if the data
+ requires additional cleanup steps, and simply releasing the memory is not
+ sufficient.
</para>
<para>