X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CCFFA329E43 for ; Tue, 21 Sep 2004 00:27:56 +0100 (BST) 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 57628-08 for ; Mon, 20 Sep 2004 23:27:48 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 5971A329E15 for ; Tue, 21 Sep 2004 00:27:50 +0100 (BST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id E8E3C3576F; Mon, 20 Sep 2004 16:27:50 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id E73643562D; Mon, 20 Sep 2004 16:27:50 -0700 (PDT) Date: Mon, 20 Sep 2004 16:27:50 -0700 (PDT) From: Stephan Szabo To: Jaime Casanova Cc: pgsql-admin@postgresql.org Subject: Re: unique constraints on foreign keys In-Reply-To: <20040920231852.9042.qmail@web50002.mail.yahoo.com> Message-ID: <20040920162457.D84638@megazone.bigpanda.com> References: <20040920231852.9042.qmail@web50002.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE 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: 200409/180 X-Sequence-Number: 14883 On Mon, 20 Sep 2004, Jaime Casanova wrote: > --- Stephan Szabo > escribi=F3: > > > > On Mon, 20 Sep 2004, Jaime Casanova wrote: > > > > > There is a way to not enforce the creation of a > > > primary or unique index on a referenced table? > > > > Not really. It's not the index that's important > > per-se, it's the uniqueness that is implied. > > OK. What about to teach the planner always do a > seq on that table and do not ask for use the > index? but not using "set" instructions. can i do > that? Not really. Are you worried about the cost of doing the plan analysis for the index scan or that it might choose to actually use the index? Theoretically, it's only going to currently plan the fk scan on status once per connection because that plan should be saved.