Skip site navigation (1) Skip section navigation (2)

pgsql: Change planner to use the current true disk file size as its

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change planner to use the current true disk file size as its
Date: 2004-12-01 19:00:59
Message-ID: 20041201190059.DC9153A5344@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Change planner to use the current true disk file size as its estimate of
a relation's number of blocks, rather than the possibly-obsolete value
in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
to arrive at a hopefully more accurate number of rows.  When pg_class
contains 0/0, estimate a tuple width from the column datatypes and divide
that into current file size to estimate number of rows.  This improved
methodology allows us to jettison the ancient hacks that put bogus default
values into pg_class when a table is first created.  Also, per a suggestion
from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
it puts into pg_class.reltuples to try to represent the mean tuple density
instead of the minimal density that actually prevails just after VACUUM.
These changes alter the plans selected for certain regression tests, so
update the expected files accordingly.  (I removed join_1.out because
it's not clear if it still applies; we can add back any variant versions
as they are shown to be needed.)

Modified Files:
--------------
    pgsql/doc/src/sgml:
        catalogs.sgml (r2.92 -> r2.93)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml.diff?r1=2.92&r2=2.93)
        diskusage.sgml (r1.11 -> r1.12)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/diskusage.sgml.diff?r1=1.11&r2=1.12)
        perform.sgml (r1.47 -> r1.48)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/perform.sgml.diff?r1=1.47&r2=1.48)
        release.sgml (r1.314 -> r1.315)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/release.sgml.diff?r1=1.314&r2=1.315)
    pgsql/src/backend/access/nbtree:
        nbtree.c (r1.122 -> r1.123)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtree.c.diff?r1=1.122&r2=1.123)
    pgsql/src/backend/catalog:
        heap.c (r1.276 -> r1.277)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/heap.c.diff?r1=1.276&r2=1.277)
        index.c (r1.241 -> r1.242)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c.diff?r1=1.241&r2=1.242)
    pgsql/src/backend/commands:
        vacuum.c (r1.295 -> r1.296)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuum.c.diff?r1=1.295&r2=1.296)
        vacuumlazy.c (r1.48 -> r1.49)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuumlazy.c.diff?r1=1.48&r2=1.49)
    pgsql/src/backend/optimizer/util:
        plancat.c (r1.97 -> r1.98)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/plancat.c.diff?r1=1.97&r2=1.98)
        relnode.c (r1.62 -> r1.63)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/relnode.c.diff?r1=1.62&r2=1.63)
    pgsql/src/include/access:
        genam.h (r1.45 -> r1.46)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/genam.h.diff?r1=1.45&r2=1.46)
    pgsql/src/include/nodes:
        relation.h (r1.100 -> r1.101)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h.diff?r1=1.100&r2=1.101)
    pgsql/src/test/regress/expected:
        case.out (r1.6 -> r1.7)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/case.out.diff?r1=1.6&r2=1.7)
        inherit.out (r1.16 -> r1.17)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/inherit.out.diff?r1=1.16&r2=1.17)
        join.out (r1.19 -> r1.20)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/join.out.diff?r1=1.19&r2=1.20)
        polymorphism.out (r1.5 -> r1.6)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/polymorphism.out.diff?r1=1.5&r2=1.6)

Removed Files:
-------------
    pgsql/src/test/regress/expected:
        join_1.out
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/join_1.out)

pgsql-committers by date

Next:From: Tom LaneDate: 2004-12-01 19:32:14
Subject: pgsql: Clarify documentation of age() functions.
Previous:From: Bruce MomjianDate: 2004-12-01 17:39:20
Subject: pgsql: Add: > * Allow ecpg to work with MSVC and BCC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group