postgresql/src/backend
Bruce Momjian 15ce2d2e4a > I can see a couple possible downsides: (a) the library might have some
> weird behavior across fork boundaries; (b) the additional memory space
> that has to be duplicated into child processes will cost something per
> child launch, even if the child never uses it.  But these are only
> arguments that it might not *always* be a prudent thing to do, not that
> we shouldn't give the DBA the tool to do it if he wants.  So fire away.

Here is a patch for the above, including a documentation update. It
creates a new GUC variable "preload_libraries", that accepts a list in
the form:

   preload_libraries = '$libdir/mylib1:initfunc,$libdir/mylib2'

If ":initfunc" is omitted or not found, no initialization function is
executed, but the library is still preloaded. If "$libdir/mylib" isn't
found, the postmaster refuses to start.

In my testing with PL/R, it reduces the first call to a PL/R function
(after connecting) from almost 2 seconds, down to about 8 ms.

Joe Conway
2003-03-20 04:51:44 +00:00
..
access Remove unneeded dash blocks around function start comments. 2003-03-14 22:40:31 +00:00
bootstrap Add code to dump contents of free space map into $PGDATA/global/pg_fsm.cache 2003-03-06 00:04:27 +00:00
catalog Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
commands Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
executor Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
lib Remove bit.c/h routines. Not used anymore. 2003-01-09 01:23:55 +00:00
libpq Add start time to pg_stat_activity 2003-03-20 03:34:57 +00:00
main This patch removes a bunch of superfluous #include directives: if 2002-11-08 20:23:57 +00:00
nodes Restructure parsetree representation of DECLARE CURSOR: now it's a 2003-03-10 03:53:52 +00:00
optimizer Make eval_const_expressions simplify FieldSelect from a whole-row Var 2003-03-14 00:55:17 +00:00
parser Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options 2003-03-11 19:40:24 +00:00
po Most of the code follows the American spelling of the word, which is 2002-11-19 17:21:40 +00:00
port This patch fixes a bunch of spelling mistakes in comments throughout the 2003-03-10 22:28:22 +00:00
postmaster > I can see a couple possible downsides: (a) the library might have some 2003-03-20 04:51:44 +00:00
regex Replace regular expression package with Henry Spencer's latest version 2003-02-05 17:41:33 +00:00
rewrite Remove REWRITE_INVOKE_MAX in favor of making an accurate check for 2003-02-25 23:47:43 +00:00
storage Add code to dump contents of free space map into $PGDATA/global/pg_fsm.cache 2003-03-06 00:04:27 +00:00
tcop Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options 2003-03-11 19:40:24 +00:00
utils > I can see a couple possible downsides: (a) the library might have some 2003-03-20 04:51:44 +00:00
Makefile Move pg_service.conf.sample to /interfaces/libpq. 2003-02-03 14:24:07 +00:00
nls.mk Translation updates 2002-09-14 13:46:24 +00:00