aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-02-15 21:57:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-02-15 21:57:43 +0000
commit6da3b76a94bffb90b8edbd86963fb4d15b6c6b43 (patch)
tree20afbb1fa495b57be74b6e83bed7ff571b57594e /src/backend/utils/adt
parentdb3ac67d8f0e00949dcca3691ab00d1d2f8e1e72 (diff)
downloadpostgresql-6da3b76a94bffb90b8edbd86963fb4d15b6c6b43.tar.gz
postgresql-6da3b76a94bffb90b8edbd86963fb4d15b6c6b43.zip
Add some notes about memory management of RI plans.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/ri_triggers.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 77d5c79feaf..94d9b7313a1 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -4,9 +4,21 @@
* Generic trigger procedures for referential integrity constraint
* checks.
*
- * 1999 Jan Wieck
+ * Note about memory management: the private hashtables kept here live
+ * across query and transaction boundaries, in fact they live as long as
+ * the backend does. This works because the hashtable structures
+ * themselves are allocated by dynahash.c in its permanent DynaHashCxt,
+ * and the parse/plan node trees they point to are copied into
+ * TopMemoryContext using SPI_saveplan(). This is pretty ugly, since there
+ * is no way to free a no-longer-needed plan tree, but then again we don't
+ * yet have any bookkeeping that would allow us to detect that a plan isn't
+ * needed anymore. Improve it someday.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.20 2000/12/22 18:35:09 tgl Exp $
+ *
+ * Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group
+ * Copyright 1999 Jan Wieck
+ *
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.21 2001/02/15 21:57:43 tgl Exp $
*
* ----------
*/