pgsql: When estimating without benefit of MCV lists (suggesting that one - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: When estimating without benefit of MCV lists (suggesting that one
Date
Msg-id 20081023002451.2077D7545A4@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
When estimating without benefit of MCV lists (suggesting that one or both
inputs is unique or nearly so), make eqjoinsel() clamp the ndistinct estimates
to be not more than the estimated number of rows coming from the input
relations.  This allows the estimate to change in response to the selectivity
of restriction conditions on the inputs.

This is a pretty narrow patch and maybe we should be more aggressive about
similarly clamping ndistinct in other cases; but I'm worried about
double-counting the effects of the restriction conditions.  However, it seems
to help for the case exhibited by Grzegorz Jaskiewicz (antijoin against a
small subset of a relation), so let's try this for awhile.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        selfuncs.c (r1.256 -> r1.257)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.256&r2=1.257)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Dept of better ideas: refrain from creating the planner's
Next
From: petere@postgresql.org (Peter Eisentraut)
Date:
Subject: pgsql: Feature T401 is not listed in the SQL standard.