postgresql/src
Tom Lane ba42002461 Revise handling of dropped columns in JOIN alias lists to avoid a
performance problem pointed out by phil@vodafone: to wit, we were
spending O(N^2) time to check dropped-ness in an N-deep join tree,
even in the case where the tree was freshly constructed and couldn't
possibly mention any dropped columns.  Instead of recursing in
get_rte_attribute_is_dropped(), change the data structure definition:
the joinaliasvars list of a JOIN RTE must have a NULL Const instead
of a Var at any position that references a now-dropped column.  This
costs nothing during normal parse-rewrite-plan path, and instead we
have a linear-time update to make when loading a stored rule that
might contain now-dropped columns.  While at it, move the responsibility
for acquring locks on relations referenced by rules into this separate
function (which I therefore chose to call AcquireRewriteLocks).
This saves effort --- namely, duplicated lock grabs in parser and rewriter
--- in the normal path at a cost of one extra non-locked heap_open()
in the stored-rule path; seems a good tradeoff.  A fringe benefit is
that it is now *much* clearer that we acquire lock on relations referenced
in rules before we make any rewriter decisions based on their properties.
(I don't know of any bug of that ilk, but it wasn't exactly clear before.)
2005-06-03 23:05:30 +00:00
..
backend Revise handling of dropped columns in JOIN alias lists to avoid a 2005-06-03 23:05:30 +00:00
bin The no-lexer-backup speedup hadn't been there a week before somebody 2005-06-02 17:45:19 +00:00
include Revise handling of dropped columns in JOIN alias lists to avoid a 2005-06-03 23:05:30 +00:00
interfaces - Fixed memory leak in ecpglib by adding some missing free() commands. 2005-06-02 12:35:11 +00:00
makefiles Add a --dbname option to the pg_regress script, and use pl_regression 2005-05-17 18:26:23 +00:00
pl Modify hash_search() API to prevent future occurrences of the error 2005-05-29 04:23:07 +00:00
port Add parentheses to macros when args are used in computations. Without 2005-05-25 21:40:43 +00:00
template Support Sun's compiler on SunOS4 (a/k/a Solaris 9). Per ayan@ayan.net 2004-12-29 23:47:40 +00:00
test When enqueueing after-row triggers for updates of a table with a foreign 2005-05-30 07:20:59 +00:00
timezone Modify hash_search() API to prevent future occurrences of the error 2005-05-29 04:23:07 +00:00
tools Fix compile of entab to use stdarg.h. Clean up includes. 2005-05-27 15:15:31 +00:00
tutorial Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
utils PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with 2004-07-30 12:26:40 +00:00
bcc32.mak Add -N make flag to bcc builds from /src dir. 2005-05-13 18:12:35 +00:00
DEVELOPERS just testing a script... 1999-07-30 03:45:57 +00:00
Makefile Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
Makefile.global.in Add a --dbname option to the pg_regress script, and use pl_regression 2005-05-17 18:26:23 +00:00
Makefile.shlib Fix up makefile dependencies for pg_config_paths.h. 2004-11-20 21:13:06 +00:00
nls-global.mk More locale fixes for pg_ctl. 2004-06-01 03:32:42 +00:00
win32.mak $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00