postgresql/src
Tom Lane f3ff0433ab In planner, don't assume that empty parent tables aren't really empty.
There's a heuristic in estimate_rel_size() to clamp the minimum size
estimate for a table to 10 pages, unless we can see that vacuum or analyze
has been run (and set relpages to something nonzero, so this will always
happen for a table that's actually empty).  However, it would be better
not to do this for inheritance parent tables, which very commonly are
really empty and can be expected to stay that way.  Per discussion of a
recent pgsql-performance report from Anish Kejariwal.  Also prevent it
from happening for indexes (although this is more in the nature of
documentation, since CREATE INDEX normally initializes relpages to
something nonzero anyway).

Back-patch to 9.0, because the ability to collect statistics across a
whole inheritance tree has improved the planner's estimates to the point
where this relatively small error makes a significant difference.  In the
referenced report, merge or hash joins were incorrectly estimated as
cheaper than a nestloop with inner indexscan on the inherited table.
That was less likely before 9.0 because the lack of inherited stats would
have resulted in a default (and rather pessimistic) estimate of the cost
of a merge or hash join.
2011-07-14 17:30:57 -04:00
..
backend In planner, don't assume that empty parent tables aren't really empty. 2011-07-14 17:30:57 -04:00
bin Add \ir command to psql. 2011-07-06 11:45:13 -04:00
include Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:39 -04:00
interfaces Add missing file to GETTEXT_FILES 2011-06-27 00:58:35 +03:00
makefiles Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
pl Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
port Add \ir command to psql. 2011-07-06 11:45:13 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:39 -04:00
timezone Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
tools Blind attempt at fixing isolation_tester on Win32 2011-07-13 01:10:26 -04:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02: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 Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls-global.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00