postgresql/src
Tom Lane cf82452855 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:31:12 -04:00
..
backend In planner, don't assume that empty parent tables aren't really empty. 2011-07-14 17:31:12 -04:00
bin Fix psql's counting of script file line numbers during COPY. 2011-07-05 12:05:15 -04:00
include Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:53 -04:00
interfaces Capitalization fixes 2011-06-19 00:39:19 +03:00
makefiles Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
pl Put comments on the installable procedural languages. 2011-07-03 19:04:05 -04:00
port Unify spelling of "canceled", "canceling", "cancellation" 2011-07-02 23:30:01 +03: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:53 -04:00
timezone Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
tools Back-patch Fix bat file quoting of %ENV from commit 19b7fac8. 2011-07-04 10:44:07 -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
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +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:27 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00