Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOrK3-0005Lt-HX for pgsql-performance@arkaria.postgresql.org; Sun, 07 Apr 2013 15:15:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UOrK2-0005tH-UE for pgsql-performance@arkaria.postgresql.org; Sun, 07 Apr 2013 15:15:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOrK0-0005t6-Nc for pgsql-performance@postgresql.org; Sun, 07 Apr 2013 15:15:56 +0000 Received: from nm35-vm4.bullet.mail.bf1.yahoo.com ([72.30.238.76]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UOrJo-0001R5-Ir for pgsql-performance@postgresql.org; Sun, 07 Apr 2013 15:15:56 +0000 Received: from [98.139.215.142] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 07 Apr 2013 15:15:42 -0000 Received: from [98.139.215.230] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 07 Apr 2013 15:15:42 -0000 Received: from [127.0.0.1] by omp1070.mail.bf1.yahoo.com with NNFMP; 07 Apr 2013 15:15:42 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 912558.26258.bm@omp1070.mail.bf1.yahoo.com Received: (qmail 50714 invoked by uid 60001); 7 Apr 2013 15:15:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1365347742; bh=irfKpWMLZVyPDLhwdXCNSiSu8eI2IoFRCuVXq6vhvoQ=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=SCW5nPbwFJ7SGVkVhq0PSvCAhHpXD8CRptWnoo0fAuqjkfC8n+9r/FBXCqUGLOhGiu6wnJdP53kGFJid7nhsU5iT5mBzk9EhnXr2OlNmOdYhfCVr8DHEbT+irC7Rit0DI0Kx7FOkAQQvcWmiEyTPVajO0R6Q+1aKEVORNWFr+K0= 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:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=n7JyXvG9oXpvngusp63gYb55+ixEht9/8sDsxYk2GvgF04N5gra3aGlYIFjf1A7T0GEUzPb+ZqbMvHlWWN61MwXR83eEBaVzTGUNKgbW4yqM6+nlqEPHwSgozp7/qbxikIht7h1FlWHmGF9ANGcZ2Kl6MVMxknzLSvho0OOxpVw=; X-YMail-OSG: 41dcj14VM1mZpe9eEeFAG_oz9N8RNG.3Jm8WMTR0Q8Q3ApZ oVZ8RrSZ2bnTk9TqixKVhWwy71NXrX3efQFveFZeB2w9grqNtpT53V_7MSoh KM1YVTueCIv8pnQKiqvMaolok.DtjvhkxCZiUMxUTu9HnDEuN5.dH5kRQnOs sri82RG8a.nLiY6NGqJuZvsgqhPY9OrX3nnGW1m7zSP5YrQWLKCKAdewFxzS g8ou6PwT2umY4NutmZSYUdVFHr6QuAHY8zoo5t1e6NyA9jtVQDclDmGb5FKo KIad2m1Ux3Pq6Fky8D4cFnKupd30FiIPe9Uo3xp3PxLaNicixDeB8KINLOHo OfVp5P2pR54L7LPiJfm66kTUVrjyg7RDT_Bml76TB9s8M5Z0bVscF.3oP64J e_Vj1nI6LbB244RX9ETbK9gDZ8cO7oYOb01kGFDUQxay_cMmMVG9WsO.NY9U wf69Zamt5ZfxF4MZ5jjC8xvwUU0Dor34BEAm_4I6NBv64UNPU86T2QE4YJvA XTPy8.UFDkGeFz9CYxmpha4A_GOuh9fGneoOM1_C0 Received: from [76.255.18.237] by web162901.mail.bf1.yahoo.com via HTTP; Sun, 07 Apr 2013 08:15:42 PDT X-Rocket-MIMEInfo: 002.001, R3JlZyBXaWxsaWFtc29uIDxnd2lsbGlhbXNvbjM5QHlhaG9vLmNvbT4gd3JvdGU6Cgo.PiBUaGFua3MgZm9yIHlvdXIgcmVzcG9uc2UuIEkgdHJpZWQgZG9pbmcgd2hhdCB5b3Ugc3VnZ2VzdGVkIHNvCj4.IHRoYXQgdGFibGUgbm93IGhhcyBhIHByaW1hcnkga2V5IG9mCj4.ICcgQ09OU1RSQUlOVCBkYXRhX2FyZWFfcGtleSBQUklNQVJZIEtFWShhcmVhX2lkICwgZGF0YV9pZCApOyAnCj4.IGFuZCBJJ3ZlIGFkZGVkIHRoZSBJTkRFWCBvZgo.PiAnQ1JFQVRFIElOREVYIGRhdGFfYXJlYV9kYXRhX2lkX2luZGUBMAEBAQE- X-Mailer: YahooMailWebService/0.8.140.532 References: <1365179846.6562.YahooMailNeo@web162903.mail.bf1.yahoo.com> <1365330080.67650.YahooMailNeo@web125903.mail.ne1.yahoo.com> Message-ID: <1365347742.50505.YahooMailNeo@web162901.mail.bf1.yahoo.com> Date: Sun, 7 Apr 2013 08:15:42 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: INDEX Performance Issue To: Greg Williamson , Mark Davidson Cc: "pgsql-performance@postgresql.org" In-Reply-To: <1365330080.67650.YahooMailNeo@web125903.mail.ne1.yahoo.com> 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 Greg Williamson wrote: >> Thanks for your response. I tried doing what you suggested so >> that table now has a primary key of >> ' CONSTRAINT data_area_pkey PRIMARY KEY(area_id , data_id ); ' >> and I've added the INDEX of >> 'CREATE INDEX data_area_data_id_index ON data_area USING btree (data_id = );' Yeah, that is what I was suggesting. >> unfortunately it hasn't resulted in an improvement of the query >> performance. > Did you run analyze on the table after creating the index ? That probably isn't necessary.=A0 Statistics are normally on relations and columns; there are only certain special cases where an ANALYZE is needed after an index build, like if the index is on an expression rather than a list of columns. Mark, what happens if you change that left join to a normal (inner) join?=A0 Since you're doing an inner join to data_area and that has a foreign key to area, there should always be a match anyway, right? The optimizer doesn't recognize that, so it can't start from the area and just match to the appropriate points. --=20 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