Re: A question about plans and multi-key pks - Mailing list pgsql-general

From Tom Lane
Subject Re: A question about plans and multi-key pks
Date
Msg-id 37752.1430498597@sss.pgh.pa.us
Whole thread Raw
In response to A question about plans and multi-key pks  (Steve Rogerson <steve.pg@yewtc.demon.co.uk>)
List pgsql-general
Steve Rogerson <steve.pg@yewtc.demon.co.uk> writes:
> Why does the plan come up with 67 rows, when by definition there can be at
> most one as we are searching on the pk?

The rowcount estimate is made by combining selectivities of the WHERE
conditions; what you're seeing is a consequence of not having very good
knowledge about cross-column correlations.  The actual details of the plan
(ie, that the pkey index can be used) are determined much later.

            regards, tom lane


pgsql-general by date:

Previous
From: Steve Rogerson
Date:
Subject: A question about plans and multi-key pks
Next
From: Jerry Sievers
Date:
Subject: Re: pg_dump permssion denied problem