postgresql/src/backend
Tom Lane 21a39de580 Tweak index costing for problems with partial indexes.
btcostestimate() makes an estimate of the number of index tuples that will
be visited based on knowledge of which index clauses can actually bound the
scan within nbtree.  However, it forgot to account for partial indexes in
this calculation, with the result that the cost of the index scan could be
significantly overestimated for a partial index.  Fix that by merging the
predicate with the abbreviated indexclause list, in the same way as we do
with the full list to estimate how many heap tuples will be visited.

Also, slightly increase the "fudge factor" that's meant to give preference
to smaller indexes over larger ones.  While this is applied to all indexes,
it's most important for partial indexes since it can be the only factor
that makes a partial index look cheaper than a similar full index.
Experimentation shows that the existing value is so small as to easily get
swamped by noise such as page-boundary-roundoff behavior.  I'm tempted to
kick it up more than this, but will refrain for now.

Per report from Ruben Blanco.  These are long-standing issues, but given
the lack of prior complaints I'm not going to risk changing planner
behavior in back branches by back-patching.
2012-01-29 18:37:14 -05:00
..
access Allow pg_basebackup from standby node with safety checking. 2012-01-25 18:02:04 +00:00
bootstrap Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
catalog Show default privileges in information schema 2012-01-27 21:58:51 +02:00
commands Disallow ALTER DOMAIN on non-domain type everywhere 2012-01-27 21:20:34 +02:00
executor Fix handling of data-modifying CTE subplans in EvalPlanQual. 2012-01-28 17:43:57 -05:00
foreign Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
lib Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
libpq Revert unfortunate whitespace change 2012-01-27 21:39:38 +02:00
main Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
nodes Use parameterized paths to generate inner indexscans more flexibly. 2012-01-27 19:26:38 -05:00
optimizer Fix pushing of index-expression qualifications through UNION ALL. 2012-01-29 16:31:23 -05:00
parser ALTER <thing> [IF EXISTS] ... allows silent DDL if required, 2012-01-23 23:25:04 +00:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Fix poll() implementation of WaitLatchOrSocket to notice postmaster death. 2012-01-15 22:08:03 +02:00
postmaster Make bgwriter sleep longer when it has no work to do, to save electricity. 2012-01-26 18:39:13 +02:00
regex Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
replication Allow pg_basebackup from standby node with safety checking. 2012-01-25 18:02:04 +00:00
rewrite Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Prevent logging "failed to stat file: success" for temp files 2012-01-28 10:03:26 +01:00
tcop ALTER <thing> [IF EXISTS] ... allows silent DDL if required, 2012-01-23 23:25:04 +00:00
tsearch Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
utils Tweak index costing for problems with partial indexes. 2012-01-29 18:37:14 -05:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
nls.mk Sort file list when creating gettext-files 2011-12-27 20:20:56 +02:00