From rjessil@yahoo.com Wed Jul 25 17:20:51 2007 Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 311979FB6B5 for ; Wed, 25 Jul 2007 14:20:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 19947-08 for ; Wed, 25 Jul 2007 14:20:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56410.mail.re3.yahoo.com (web56410.mail.re3.yahoo.com [216.252.111.89]) by postgresql.org (Postfix) with SMTP id AA5E89FB5DD for ; Wed, 25 Jul 2007 14:20:46 -0300 (ADT) Received: (qmail 13306 invoked by uid 60001); 25 Jul 2007 17:20:45 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=IuxgT+kZVqlK2t1T42Z0MMKZaB++MBlmDISSGu+XrZ8+FINO3fghIaNfPN61YasjNvlkT68WyeWc5WIjXczmPo4BcPVzfyW41+Z7Gavc1A1BL3OkFkTu7bGqBHzZef/xVmAMg4g0dY8/8dqJWFjVFW7NrhVC0T9V+pYsY+TPp9A=; X-YMail-OSG: JkISSwQVM1m6ips9xMVco2okfP_WXevIwD1xm96nHqr1iV4alWOfoefLW26LfznkP2zrSfDI2rpAJlT.tE990zT.emELtj4FFzlE Received: from [198.119.134.32] by web56410.mail.re3.yahoo.com via HTTP; Wed, 25 Jul 2007 10:20:45 PDT Date: Wed, 25 Jul 2007 10:20:45 -0700 (PDT) From: Jessica Richard Subject: primary key and foreign key To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-978061239-1185384045=:12661" Content-Transfer-Encoding: 8bit Message-ID: <768150.12661.qm@web56410.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.207 tagged_above=0 required=5 tests=AWL=0.391, BAYES_40=-0.185, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200707/282 X-Sequence-Number: 26263 --0-978061239-1185384045=:12661 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Just want to be very clear that: 1. adding a primary key will have an implicit index automatically on the column(s). 2. Adding a foreign key will NOT have an index created automatically, it only does the referencing work. If an index is needed on the F-key column, it has to be created, right? Thanks. --------------------------------- Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. --0-978061239-1185384045=:12661 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Just want to be very clear that:

1. adding a primary key will have an implicit index automatically on the column(s).

2. Adding a foreign key will NOT have an index created automatically, it only does the referencing work. If an index is needed on the F-key column, it has to be created, right?

Thanks.


Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. --0-978061239-1185384045=:12661-- From rabroersma@yahoo.com Wed Jul 25 17:25:57 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B14919FBCA4 for ; Wed, 25 Jul 2007 14:25:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 29874-08 for ; Wed, 25 Jul 2007 14:25:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31809.mail.mud.yahoo.com (web31809.mail.mud.yahoo.com [68.142.207.72]) by postgresql.org (Postfix) with SMTP id 1862B9FBC87 for ; Wed, 25 Jul 2007 14:25:54 -0300 (ADT) Received: (qmail 91032 invoked by uid 60001); 25 Jul 2007 17:25:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=OXqddkmuX50W11KbXj/rCaFps7cfm7jiESet3dk5h3SXg4ebCk2vIzvyv9UU8hbJkW8flFp9jLFeiD5srLhBFddR0WwS5lqXXc6zbmim2HSQDsfY1duVjQkYPX2+1LRM+I56AZ0HoO0hBXtZpphTL9nh2eXcjvxOrjXkV3B1XEU=; X-YMail-OSG: DXhauucVM1kJLnORzzHNUOVc.h.noxfzk0WbmeIKxxWvDNwosU.rYfZ_0vbNxWdSyAin7uplPg-- Received: from [12.180.237.138] by web31809.mail.mud.yahoo.com via HTTP; Wed, 25 Jul 2007 10:25:53 PDT Date: Wed, 25 Jul 2007 10:25:53 -0700 (PDT) From: Richard Broersma Jr Subject: Re: primary key and foreign key To: Jessica Richard , pgsql-admin@postgresql.org In-Reply-To: <768150.12661.qm@web56410.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <219041.90797.qm@web31809.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.229 tagged_above=0 required=5 tests=AWL=0.228, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/283 X-Sequence-Number: 26264 --- Jessica Richard wrote: > Just want to be very clear that: > > 1. adding a primary key will have an implicit index automatically on the column(s). > > 2. Adding a foreign key will NOT have an index created automatically, it only does the > referencing work. If an index is needed on the F-key column, it has to be created, right? Correct. Regards, Richard Broersma Jr.