Re: 7.4 - FK constraint performance - Mailing list pgsql-sql

From Tom Lane
Subject Re: 7.4 - FK constraint performance
Date
Msg-id 27443.1076646336@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.4 - FK constraint performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: 7.4 - FK constraint performance  (Richard Huxton <dev@archonet.com>)
Re: 7.4 - FK constraint performance  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: 7.4 - FK constraint performance  (Rod Taylor <rbt@rbt.ca>)
Re: 7.4 - FK constraint performance  (Rod Taylor <rbt@rbt.ca>)
List pgsql-sql
Rod Taylor <rbt@rbt.ca> writes:
> Statistics say there are 10 values. Statistics list the 10 most common
> values (all of them). Given this, would it not be reasonable to assume
> that 239 is a recent addition (if there at all) to the table and not
> very common?

We don't know that it's 239 when we make the plan.  In order to know
that, we'd have to abandon caching of RI check query plans and re-plan
for each row.  That strikes me as inevitably a losing proposition.
        regards, tom lane


pgsql-sql by date:

Previous
From: "David Witham"
Date:
Subject: Index question
Next
From: Tom Lane
Date:
Subject: Re: 7.4 - FK constraint performance