From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Claudio Freire <klaussfreire@gmail.com>
Cc: Horst Dehmer <horst.dehmer@gmail.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Insert performance for large transaction with multiple COPY FROM
Date: Sat, 12 Jan 2013 17:26:51 -0500
Message-ID: <24687.1358029611@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1yqR-OGy7kxPWOXcvoYKUrKRKqVFpbmwTGgtQzhHBx05w@mail.gmail.com>
References: <78A65A52-C49D-4CA4-9A63-1F5F120BC7E7@gmail.com>
<CAGTBQpavK111WhRZYk1pfRsv3ixn-VnQKD1EZbbD=Yg-y4pZ+Q@mail.gmail.com>
<CAMkU=1yqR-OGy7kxPWOXcvoYKUrKRKqVFpbmwTGgtQzhHBx05w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Jeff Janes <jeff.janes@gmail.com> writes:
> Will PG allow you to add a FK constraint where there is no usable
> index on the referenced side?
It will not, because the referenced side must have a unique constraint,
ie an index.
The standard performance gotcha here is not having an index on the
referencing side. But that only hurts when doing UPDATEs/DELETEs of
referenced-side keys, which as far as I gathered was not the OP's
scenario.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, klaussfreire@gmail.com, horst.dehmer@gmail.com
Subject: Re: Insert performance for large transaction with multiple COPY FROM
In-Reply-To: <24687.1358029611@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