pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ow <oneway_111@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: FK Constraints, indexes and performance
Date: Mon, 06 Oct 2003 00:40:03 -0400
Message-ID: <19626.1065415203@sss.pgh.pa.us> (raw)
In-Reply-To: <20031006002959.13352.qmail@web21401.mail.yahoo.com>
References: <20031006002959.13352.qmail@web21401.mail.yahoo.com>

ow <oneway_111@yahoo.com> writes:
> It's understood that FK constraints carry some performance hit. However, the
> performance hit I observe is huge.

It looks to me like the 7.3 planner will not choose indexscans for the FK
check queries in this example, because the comparison operators are
misconstrued as shown in this thread:
http://archives.postgresql.org/pgsql-hackers/2003-03/msg00997.php
The equality operator on your domain is taken to be "oideq" which won't
be the same operator associated with the index on the column.

This seems to be fixed in 7.4.  In 7.3 I'd counsel not introducing
domains unnecessarily.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <19626.1065415203@sss.pgh.pa.us>
Permalink:  ../19626.1065415203@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19626.1065415203@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, oneway_111@yahoo.com
  Subject: Re: FK Constraints, indexes and performance
  In-Reply-To: <19626.1065415203@sss.pgh.pa.us>

* 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