X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id DF78CCBC91 for ; Mon, 14 Jul 2003 11:43:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 74266-05 for ; Mon, 14 Jul 2003 11:43:59 +0000 (GMT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 8123ECBC7B for ; Mon, 14 Jul 2003 08:43:36 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19c1kP-0004cm-00 for ; Mon, 14 Jul 2003 07:44:01 -0400 Received: by dba2 (Postfix, from userid 1019) id E22FBCEC9; Mon, 14 Jul 2003 07:44:24 -0400 (EDT) Date: Mon, 14 Jul 2003 07:44:24 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Pgsql - Red Hat Linux - VS MySQL VS MSSQL Message-ID: <20030714114424.GH24166@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <001001c34908$fc98bc60$0600a8c0@home01> <1058100557.19798.20.camel@haggis> <008801c34976$e58a4ac0$0600a8c0@home01> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <008801c34976$e58a4ac0$0600a8c0@home01> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/216 X-Sequence-Number: 2509 On Sun, Jul 13, 2003 at 12:42:29PM -0700, Balazs Wellisch wrote: > > On Sun, 2003-07-13 at 01:35, Balazs Wellisch wrote: > > Note that I've read a couple of times from Tom Lane (one of the > > core team) that FKs are a serous performance drag, so I'd drop > > them after the s/w has been in production long enough to work > > out the kinks. > > > > That's interesting, I didn't know that. Any idea how much of a performance > drag we're talking about? Foreign keys in any database are going to cost you something, because they require a lookup in other tables. The big hit from FKs in PostgreSQL used to be that they caused deadlocks in older versions. I _think_ this is fixed by default in 7.3.3; if not, there's a patch floating around for the problem. The repair is definitely in 7.4. That said, if speed is your goal, FKs are always going to be a cost for you. OTOH, people who try to handle this sort of thing in the application come to regret it. You probably want to look somewhere else to solve your performance difficulties from FKs. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110