Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0GTd-0004Mq-Tk for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 20:41:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X0GTd-0006Le-8j for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 20:41:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X0GTc-0006LY-6O for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 20:41:00 +0000 Received: from qmta07.emeryville.ca.mail.comcast.net ([2001:558:fe2d:43:76:96:30:64]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0GTY-00063N-Uz for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 20:40:57 +0000 Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta07.emeryville.ca.mail.comcast.net with comcast id K8He1o0030S2fkCA78gvNa; Thu, 26 Jun 2014 20:40:55 +0000 Received: from [IPV6:2600:1001:b001:8f4c:bf8b:880b:9cf5:bc23] ([IPv6:2600:1001:b001:8f4c:bf8b:880b:9cf5:bc23]) by omta09.emeryville.ca.mail.comcast.net with comcast id K8gt1o00l2XkQde8V8guQJ; Thu, 26 Jun 2014 20:40:55 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <53AB2CB1.8080201@comcast.net> <53AB35CC.10202@optionshouse.com> <1801a5d4-c3f1-4c0c-9c2c-ffb9d7f723a3@email.android.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: how to improve perf of 131MM row table? From: Aaron Weber Date: Thu, 26 Jun 2014 16:40:51 -0400 To: Jeff Janes CC: Shaun Thomas , "pgsql-performance@postgresql.org" Message-ID: <69dfd7f3-ccbb-4ae9-97f0-fcb99e7c9c18@email.android.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1403815255; bh=n0mXEDfNsV3h8bue1qI8tOb2FVo7Gu6XIdCM4Fqv7tk=; h=Received:Received:MIME-Version:Content-Type:Subject:From:Date:To: Message-ID; b=uqPFijLr4IUgWcP9r3K1sMhZuSdCsl/pm3Tg6atCwjNezSJQNUFk6S7mKQ577ej0X ssaZcRbXzzuxB5H4TLz6Y/93z8Vt5o6+JtYjcaHBqFxDExa35r5qUl3m8eUPV9MIg1 q0SRJJlida9s5b0dpoCylVXpyHal2KHuiyNLZVOAjdp3tPIjKS+aeqUQdHwyAg5N6F lSSUzlz66npdIVmIUU6KmWsKBSr3WN25LVeGxsqDQRo0lrnbJvZkP7PO8OBXiMhgxS 8EDH3C5jmbHzOHnzY8YZtHbZShd5kmzQdmd6aVxw8ppTwnvS0vOKlGhHxXMrvFd2dI RGEgN81VHJqfg== X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org >The PK of the master table and the PK of the detail table cannot be >the same thing, or they would not have a master-detail relationship. >One side has to be an FK, not a PK. > Of course this is correct. I was trying to make the point that there should be unique indices (of whatever flavor PG uses for PK's by default) on the relevant columns. Since we're referring to a select statement, the actual integrity constraints should not come into play. I will remember to be more explicit about the schema next time. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance