pgsql: When estimating without benefit of MCV lists (suggesting that one

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: When estimating without benefit of MCV lists (suggesting that one
Date: 2008-10-23 00:24:51
Message-ID: 20081023002451.2077D7545A4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2008-10-23 03:31:49 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Previous Message Tom Lane 2008-10-22 22:53:29 Re: Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.