X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8DAB85E40BA for ; Fri, 13 Aug 2004 15:02:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35345-02 for ; Fri, 13 Aug 2004 18:02:03 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 693575E37CE for ; Fri, 13 Aug 2004 15:02:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7DI1xdx025255; Fri, 13 Aug 2004 14:01:59 -0400 (EDT) To: Bruno Wolff III Cc: Rod Taylor , Ulrich Wisser , gnari , Postgresql Performance Subject: Re: insert In-reply-to: <20040813150243.GA2004@wolff.to> References: <20040813111649.7B4116C4F8@tino.sinectis.com.ar> <00cc01c4812b$4e7f02e0$0100000a@wp2000> <411CAFA3.90005@relevanttraffic.se> <1092401876.16087.236.camel@jester> <20040813150243.GA2004@wolff.to> Comments: In-reply-to Bruno Wolff III message dated "Fri, 13 Aug 2004 10:02:43 -0500" Date: Fri, 13 Aug 2004 14:01:59 -0400 Message-ID: <25254.1092420119@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/215 X-Sequence-Number: 7851 Bruno Wolff III writes: > Rod Taylor wrote: >> It is likely that you are missing an index on one of those foreign key'd >> items. > I don't think that is too likely as a foreign key reference must be a > unique key which would have an index. I think the type mismatch > suggestion is probably what the problem is. I agree. It is possible to have a lack-of-index problem on the referencing column (as opposed to the referenced column), but that normally only hurts you for deletes from the referenced table. > The current solution is to make the types match. In 8.0.0 it would probably > work efficiently as is, though it isn't normal for foreign keys to have a type > mismatch and he may want to change that anyway. 8.0 will not fix this particular issue, as I did not add any numeric-vs-int comparison operators. If we see a lot of complaints we could think about adding such, but for 8.0 only the more common cases such as int-vs-bigint are covered. regards, tom lane