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

From Rod Taylor
Subject Re: 7.4 - FK constraint performance
Date
Msg-id 1076680640.10896.15.camel@jester
Whole thread Raw
In response to Re: 7.4 - FK constraint performance  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
> In this precise example, could you not:
>   1. Check index for value
>   2. If found, seq-scan
>
> Of course that's only going to be a sensible thing to do if you're expecting
> one of two results:
>   1. Value not there
>   2. Lengthy seq-scan if it is there

Most of the queries are going to be for the other values (in which case
you've wasted an index scan) which is minor, but in the event there is a
single 239 you're still taking a big hit.

That is an awful lot of work to handle the non-existant case only.

--
Rod Taylor <rbt [at] rbt [dot] ca>

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
PGP Key: http://www.rbt.ca/rbtpub.asc

pgsql-sql by date:

Previous
From: "Greg Patnude"
Date:
Subject: Re: determining how many products are in how many categories
Next
From: Rod Taylor
Date:
Subject: Re: 7.4 - FK constraint performance