postgresql/src
Tom Lane 67d0f7a379 Second try at fixing O(N^2) problem in foreign key references.
This replaces ill-fated commit 5ddc72887a,
which was reverted because it broke active uses of FK cache entries.  In
this patch, we still do nothing more to invalidatable cache entries than
mark them as needing revalidation, so we won't break active uses.  To keep
down the overhead of InvalidateConstraintCacheCallBack(), keep a list of
just the currently-valid cache entries.  (The entries are large enough that
some added space for list links doesn't seem like a big problem.)  This
would still be O(N^2) when there are many valid entries, though, so when
the list gets too long, just force the "sinval reset" behavior to remove
everything from the list.  I set the threshold at 1000 entries, somewhat
arbitrarily.  Possibly that could be fine-tuned later.  Another item for
future study is whether it's worth adding reference counting so that we
could safely remove invalidated entries.  As-is, problem cases are likely
to end up with large and mostly invalid FK caches.

Like the previous attempt, backpatch to 9.3.

Jan Wieck and Tom Lane
2015-09-25 13:16:30 -04:00
..
backend Second try at fixing O(N^2) problem in foreign key references. 2015-09-25 13:16:30 -04:00
bin Further fix for psql's code for locale-aware formatting of numeric output. 2015-09-25 12:20:45 -04:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
include Fix low-probability memory leak in regex execution. 2015-09-18 13:55:17 -04:00
interfaces Fix whitespace 2015-09-21 13:39:34 -04:00
makefiles Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:49:22 -04:00
pl Fix plpython crash when returning string representation of a RECORD result. 2015-08-21 12:21:37 -04:00
port Fix a low-probability crash in our qsort implementation. 2015-07-16 22:57:46 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:35 -04:00
test Fix possible internal overflow in numeric multiplication. 2015-09-21 12:11:49 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:51 -04:00
tools Turn install.bat into a pure one line wrapper fort he perl script. 2015-07-07 16:31:52 +03:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Revert ed47666 and part of ef57b98 2015-09-10 08:58:35 -04:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00