pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Richard Huxton <dev@archonet.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: ow <oneway_111@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: 7.4 - FK constraint performance
Date: Fri, 13 Feb 2004 08:57:20 -0500
Message-ID: <1076680640.10896.15.camel@jester> (raw)
In-Reply-To: <200402130722.17663.dev@archonet.com>
References: <20040213010341.95282.qmail@web60801.mail.yahoo.com>
	<1076640825.10896.12.camel@jester>
	<27443.1076646336@sss.pgh.pa.us>
	<200402130722.17663.dev@archonet.com>

> 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

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (29+ messages)  latest in thread

Message-ID: <1076680640.10896.15.camel@jester>
Permalink:  ../1076680640.10896.15.camel@jester/
Also on:    postgresql.org/message-id/1076680640.10896.15.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rbt@rbt.ca, dev@archonet.com, tgl@sss.pgh.pa.us, oneway_111@yahoo.com
  Subject: Re: 7.4 - FK constraint performance
  In-Reply-To: <1076680640.10896.15.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox