Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu9XY-0002Xf-P3 for pgsql-performance@arkaria.postgresql.org; Sat, 12 Jan 2013 22:27:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tu9XX-000189-OD for pgsql-performance@arkaria.postgresql.org; Sat, 12 Jan 2013 22:26:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu9XW-000183-No for pgsql-performance@postgresql.org; Sat, 12 Jan 2013 22:26:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tu9XR-0002GC-AF for pgsql-performance@postgresql.org; Sat, 12 Jan 2013 22:26:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r0CMQpPF024688; Sat, 12 Jan 2013 17:26:52 -0500 (EST) From: Tom Lane To: Jeff Janes cc: Claudio Freire , Horst Dehmer , postgres performance list Subject: Re: Insert performance for large transaction with multiple COPY FROM In-reply-to: References: <78A65A52-C49D-4CA4-9A63-1F5F120BC7E7@gmail.com> Comments: In-reply-to Jeff Janes message dated "Sat, 12 Jan 2013 13:23:33 -0800" Date: Sat, 12 Jan 2013 17:26:51 -0500 Message-ID: <24687.1358029611@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Jeff Janes 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