postgresql/src/include/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
..
acl.h Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
array.h Tweak the API for per-datatype typmodin functions so that they are passed 2007-06-15 20:56:52 +00:00
ascii.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
builtins.h Remove the 'not in' operator (!!=). This was a hangover from Berkeley 2007-08-27 01:39:25 +00:00
cash.h Widen the money type to 64 bits. 2007-01-03 01:19:51 +00:00
catcache.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
combocid.h Combine cmin and cmax fields of HeapTupleHeaders into a single field, by 2007-02-09 03:35:35 +00:00
date.h Fix up hash functions for datetime datatypes so that they don't take 2007-07-06 04:16:00 +00:00
datetime.h Minor comment fixes. 2007-06-12 16:01:31 +00:00
datum.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
dynahash.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
dynamic_loader.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
elog.h Provide for logfiles in machine readable CSV format. In consequence, rename 2007-08-19 01:41:25 +00:00
errcodes.h Implement XMLSERIALIZE for real. Analogously, make the xml to text cast 2007-02-03 14:06:56 +00:00
flatfiles.h Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
fmgrtab.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
formatting.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
geo_decls.h Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
guc.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
guc_tables.h Make configuration parameters fall back to their default values when they 2007-04-21 20:02:41 +00:00
help_config.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
hsearch.h Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
inet.h Support varlena fields with single-byte headers and unaligned storage. 2007-04-06 04:21:44 +00:00
int8.h Downgrade implicit casts to text to be assignment-only, except for the ones 2007-06-05 21:31:09 +00:00
inval.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
logtape.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
lsyscache.h Fix up text concatenation so that it accepts all the reasonable cases that 2007-06-06 23:00:50 +00:00
memutils.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
nabstime.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
numeric.h Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
palloc.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
pg_crc.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
pg_locale.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
pg_lzcompress.h Fix up bad layout of some comments (probably pg_indent's fault), and 2007-08-04 21:53:00 +00:00
pg_rusage.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
plancache.h The session_replication_role actually can be changed at will during 2007-06-05 20:00:41 +00:00
portal.h RESET SESSION, plus related new DDL commands. Patch from Marko Kreen, 2007-04-12 06:53:49 +00:00
ps_status.h Add GUC update_process_title to control whether 'ps' display is updated 2006-06-27 22:16:44 +00:00
rel.h Fix up pgstats counting of live and dead tuples to recognize that committed 2007-05-27 03:50:39 +00:00
relcache.h Teach CLUSTER to skip writing WAL if not needed (ie, not using archiving) 2007-03-29 00:15:39 +00:00
resowner.h Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with 2007-07-25 12:22:54 +00:00
selfuncs.h Apply a band-aid fix for the problem that 8.2 and up completely misestimate 2007-08-31 23:35:22 +00:00
syscache.h Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
timestamp.h Fix up hash functions for datetime datatypes so that they don't take 2007-07-06 04:16:00 +00:00
tqual.h Fix oversight in async-commit patch: there were some places in heapam.c 2007-08-14 17:35:18 +00:00
tuplesort.h Add a line to the EXPLAIN ANALYZE output for a Sort node, showing the 2007-05-04 21:29:53 +00:00
tuplestore.h Teach tuplestore.c to throw away data before the "mark" point when the caller 2007-05-21 17:57:35 +00:00
typcache.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
tzparser.h Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
uuid.h Rename the uuid_t type to pg_uuid_t, to avoid a conflict with any 2007-01-28 20:25:38 +00:00
varbit.h Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
xml.h XPath fixes: 2007-05-21 17:10:29 +00:00