pgsql: Avoid assuming that statistics for a parent relation reflect the - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Avoid assuming that statistics for a parent relation reflect the
Date
Msg-id 20060502043418.8F07D9FA5F6@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Avoid assuming that statistics for a parent relation reflect the properties of
the union of its child relations as well.  This might have been a good idea
when it was originally coded, but it's a fatally bad idea when inheritance is
being used for partitioning.  It's better to have no stats at all than
completely misleading stats.  Per report from Mark Liberman.

The bug arguably exists all the way back, but I've only patched HEAD and 8.1
because we weren't particularly trying to support partitioning before 8.1.

Eventually we ought to look at deriving union statistics instead of just
punting, but for now the drop kick looks good.

Modified Files:
--------------
    pgsql/src/backend/optimizer/path:
        allpaths.c (r1.145 -> r1.146)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/allpaths.c.diff?r1=1.145&r2=1.146)
    pgsql/src/backend/utils/adt:
        selfuncs.c (r1.203 -> r1.204)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c.diff?r1=1.203&r2=1.204)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Provide a namespace.c function for lookup of an operator with
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Avoid assuming that statistics for a parent relation reflect the