Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UO9ds-000404-Qw for pgsql-performance@arkaria.postgresql.org; Fri, 05 Apr 2013 16:37:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UO9dr-0003XQ-FM for pgsql-performance@arkaria.postgresql.org; Fri, 05 Apr 2013 16:37:31 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UO9dq-0003XK-9q for pgsql-performance@postgresql.org; Fri, 05 Apr 2013 16:37:30 +0000 Received: from nm21.bullet.mail.bf1.yahoo.com ([98.139.212.180]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UO9dn-0001Jr-Gt for pgsql-performance@postgresql.org; Fri, 05 Apr 2013 16:37:29 +0000 Received: from [98.139.212.151] by nm21.bullet.mail.bf1.yahoo.com with NNFMP; 05 Apr 2013 16:37:26 -0000 Received: from [98.139.212.225] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 05 Apr 2013 16:37:26 -0000 Received: from [127.0.0.1] by omp1034.mail.bf1.yahoo.com with NNFMP; 05 Apr 2013 16:37:26 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 779507.52689.bm@omp1034.mail.bf1.yahoo.com Received: (qmail 8786 invoked by uid 60001); 5 Apr 2013 16:37:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1365179846; bh=yDzV/TEoI2fqSswf88I1gf4DCLRCh4uJOcjvRnu9rXw=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=xkJNS3oiD9qQx0QzMnibsXbjeG00GkZrsCsDxvsbpfxnBu1n6tFW3zTzcLHgvvUhjxNnAE0AfwXAE9jUj5gDLoCNUss9FQz0BkLC2/d2tXXgtr6t4rq8cYFu8IMeBO50dpHyMQ2bOcZ2V8o/0FrTBunJ4uVu6ae1FqOa6ENwNr8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lW/RcUs5eKNo7Ut7M1EpOetS5GUIFDivl87OkX4IbUqA687JaZjbX9WJ/70Rw9RhSxESzP981ZWaC5OdfqN/3hTvKD+NtqzmJIqESYpliUkkGBQrq6elSVmTyq2LF0zWu94jeDxXxbjD+z0nNlDz+WixoHNhvhbG8BND7oqIa5k=; X-YMail-OSG: yLex0o8VM1noe7FCfLYKwKaCTXMUvX8hrgSRIQi.U_qxEuS YqlR8xeF3NKIrkufrt6.YUyWm_7sP1ZwFxFUqrrq87IEeJlNsYZiA8xdQjGf 5KZ_uT3rB.3mA_odCcXwyjGcF9JRdyksADorm4_J5wkfgb9epYXMTC8bWZbd mGOZV3b9DYZxLc4ky0dLW4.pg951zEJDvUHchiv.xRcVq0pFpifhNGZA7t3s hHkPy9vICTXNXO_Ov.omNjy1PueplDvXGZrmESWumoWvalG27FPi_4fANrOa CohXuaLtLIyL3AWL4QnBnt9mS3k25zF.TEkGhSRsLqjuyZ0p83PjUtzOlujr JqAWp4T3Hu30yQIiKQyldl55qYVpOnWqomGWcgiUFBDchkq43yUzHzzPPgpw xFObZbTxz84iyN6ixt4YADBu4RNKy4S8IA19xHpOUSDB.IuyEEvUMILYKEb9 1RXtDuGUBA8N3LlsPWstY5HvabaaiWPL70VUBqlIlyw9Po4BeRVZIuCCmjRO os5ORWoGe3WmaMfkzGrhoW_zyMEPCJvHqIgY- Received: from [76.255.18.237] by web162903.mail.bf1.yahoo.com via HTTP; Fri, 05 Apr 2013 09:37:26 PDT X-Rocket-MIMEInfo: 002.001, TWFyayBEYXZpZHNvbiA8bWFya0A0ZWFjaC5jby51az4gd3JvdGU6Cgo.wqDCoCBDT05TVFJBSU5UIGRhdGFfYXJlYV9wa2V5IFBSSU1BUlkgS0VZIChkYXRhX2lkICwgYXJlYV9pZCApLAoKU28gdGhlIG9ubHkgaW5kZXggb24gdGhpcyAyNTAgbWlsbGlvbiByb3cgdGFibGUgc3RhcnRzIHdpdGggdGhlIElECm9mIHRoZSBwb2ludCwgYnV0IHlvdSBhcmUgam9pbmluZyB0byBpdCBieSB0aGUgSUQgb2YgdGhlIGFyZWEuClRoYXQncyByZXF1aXJlcyBhIHNlcXVlbnRpYWwgc2NhbiBvZiBhbGwgMjUwIG1pbGxpb24BMAEBAQE- X-Mailer: YahooMailWebService/0.8.140.532 References: Message-ID: <1365179846.6562.YahooMailNeo@web162903.mail.bf1.yahoo.com> Date: Fri, 5 Apr 2013 09:37:26 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: INDEX Performance Issue To: Mark Davidson , "pgsql-performance@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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 Mark Davidson wrote: >=A0=A0 CONSTRAINT data_area_pkey PRIMARY KEY (data_id , area_id ), So the only index on this 250 million row table starts with the ID of the point, but you are joining to it by the ID of the area. That's requires a sequential scan of all 250 million rows.=A0 Switch the order of the columns in the primary key, add a unique index with the columns switched, or add an index on just the area ID. Perhaps you thought that the foreign key constraints would create indexes?=A0 (They don't.) -- Kevin Grittner EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance