X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 11B99D1B508 for ; Mon, 29 Sep 2003 09:57:51 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 51456-04 for ; Mon, 29 Sep 2003 06:57:22 -0300 (ADT) Received: from fuji.krosing.net (silmet.estpak.ee [194.126.97.78]) by svr1.postgresql.org (Postfix) with ESMTP id 768E7D1B4FD for ; Mon, 29 Sep 2003 06:57:19 -0300 (ADT) Received: from fuji.krosing.net (localhost.localdomain [127.0.0.1]) by fuji.krosing.net (8.12.8/8.12.8) with ESMTP id h8T9vFbd002782; Mon, 29 Sep 2003 12:57:15 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h8T9vDSu002780; Mon, 29 Sep 2003 12:57:13 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta) From: Hannu Krosing To: Andreas Pflug Cc: Christopher Kings-Lynne , PostgreSQL-development In-Reply-To: <3F77F5A6.6070107@pse-consulting.de> References: <200309281940.h8SJe3O01852@candle.pha.pa.us> <3F77ABA0.4070600@familyhealth.com.au> <3F77F5A6.6070107@pse-consulting.de> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1064829433.2645.2.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 29 Sep 2003 12:57:13 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1525 X-Sequence-Number: 44537 Andreas Pflug kirjutas E, 29.09.2003 kell 12:04: > Christopher Kings-Lynne wrote: > > > You could just as easily argue that the lack of integrity testing at > > data load time was equally a bug. > > > > I think we need someway of telling postgres to suppress a foreign key > > check. > > > > The main problem is that the foreign key column is often not indexed. > > So a db designer made a bloody mistake. > The problem is there's no easy way to find out what's missing. > I'd really like EXPLAIN to display all subsequent triggered queries > also, to see the full scans caused by missing indexes. It could probably be doable for EXPLAIN ANALYZE (by actually tracing execution), but then you will see really _all_ queries, i.e. for a 1000 row update you would see 1 UPDATE query and 1000 fk checks ... OTOH, you probably can get that already from logs with right logging parameters. ------------- Hannu