postgresql/src/backend
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
..
access Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
bootstrap Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
catalog Set information_schema.routines.is_udt_dependent to NO 2011-07-14 19:18:17 +03:00
commands Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:39 -04:00
executor Move Trigger and TriggerDesc structs out of rel.h into a new reltrigger.h 2011-07-04 14:35:58 -04:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Message style improvements of errmsg_internal() calls 2011-07-05 23:01:35 +03:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Avoid compiler warnings due to possibly unused variables 2011-06-16 23:43:56 +03:00
optimizer In planner, don't assume that empty parent tables aren't really empty. 2011-07-14 17:30:57 -04:00
parser Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
po Fixed string in German translation that causes segfault. 2011-06-20 13:53:15 +02:00
port Introduce a pipe between postmaster and each backend, which can be used to 2011-07-08 18:44:07 +03:00
postmaster Introduce a pipe between postmaster and each backend, which can be used to 2011-07-08 18:44:07 +03:00
regex Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
replication Introduce a pipe between postmaster and each backend, which can be used to 2011-07-08 18:44:07 +03:00
rewrite Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
tcop Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
tsearch Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
utils Avoid listing ungrouped Vars in the targetlist of Agg-underneath-Window. 2011-07-12 18:24:39 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Fix symlink for errcodes.h so it works in VPATH builds from tarballs. 2011-06-22 13:08:08 -04:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
nls.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00