postgresql/src/backend/utils
Tom Lane 0ee5a39862 Apply a band-aid fix for the problem that 8.2 and up completely misestimate
the number of rows likely to be produced by a query such as
	SELECT * FROM t1 LEFT JOIN t2 USING (key) WHERE t2.key IS NULL;
What this is doing is selecting for t1 rows with no match in t2, and thus
it may produce a significant number of rows even if the t2.key table column
contains no nulls at all.  8.2 thinks the table column's null fraction is
relevant and thus may estimate no rows out, which results in terrible plans
if there are more joins above this one.  A proper fix for this will involve
passing much more information about the context of a clause to the selectivity
estimator functions than we ever have.  There's no time left to write such a
patch for 8.3, and it wouldn't be back-patchable into 8.2 anyway.  Instead,
put in an ad-hoc test to defeat the normal table-stats-based estimation when
an IS NULL test is evaluated at an outer join, and just use a constant
estimate instead --- I went with 0.5 for lack of a better idea.  This won't
catch every case but it will catch the typical ways of writing such queries,
and it seems unlikely to make things worse for other queries.
2007-08-31 23:35:22 +00:00
..
adt Apply a band-aid fix for the problem that 8.2 and up completely misestimate 2007-08-31 23:35:22 +00:00
cache Simplify the syntax of CREATE/ALTER TEXT SEARCH DICTIONARY by treating the 2007-08-22 01:39:46 +00:00
error Reduce memory requirements for writing CSVlogs, so it will work with about 2007-08-23 01:24:43 +00:00
fmgr Fix security definer functions with polymorphic arguments. This case has 2007-07-31 15:49:49 +00:00
hash Fix several hash functions that were taking chintzy shortcuts instead of 2007-06-01 15:33:19 +00:00
init Move session_start out of MyProcPort stucture and make it a global called MyStartTime, 2007-08-02 23:39:45 +00:00
mb Suppress an integer-overflow warning. 2007-07-12 21:17:09 +00:00
misc Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
mmgr Remove an "optimization" I installed in 2001, to make repalloc() attempt to 2007-08-12 20:39:14 +00:00
resowner First phase of plan-invalidation project: create a plan cache management 2007-03-13 00:33:44 +00:00
sort Fix a memory leak in tuplestore_end(). Unlikely to be significant during 2007-08-02 17:48:52 +00:00
time Fix oversight in async-commit patch: there were some places in heapam.c 2007-08-14 17:35:18 +00:00
.cvsignore Cleanup to ensure good state of derived files in tarballs. 2000-06-09 02:38:36 +00:00
Gen_fmgrtab.sh Downgrade implicit casts to text to be assignment-only, except for the ones 2007-06-05 21:31:09 +00:00
Makefile Replace useless uses of := by = in makefiles. 2007-02-09 15:56:00 +00:00
probes.d DTrace support, with a small initial set of probes 2006-07-24 16:32:45 +00:00