Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrTAi-0002KH-5t for pgsql-performance@arkaria.postgresql.org; Tue, 25 Jun 2013 13:20:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UrTAh-0003FG-Ha for pgsql-performance@arkaria.postgresql.org; Tue, 25 Jun 2013 13:20:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrTAf-0003DY-SB for pgsql-performance@postgresql.org; Tue, 25 Jun 2013 13:20:34 +0000 Received: from nm8-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.95]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrTAd-0004s9-34 for pgsql-performance@postgresql.org; Tue, 25 Jun 2013 13:20:33 +0000 Received: from [98.139.212.146] by nm8.bullet.mail.bf1.yahoo.com with NNFMP; 25 Jun 2013 13:20:29 -0000 Received: from [98.139.212.219] by tm3.bullet.mail.bf1.yahoo.com with NNFMP; 25 Jun 2013 13:20:29 -0000 Received: from [127.0.0.1] by omp1028.mail.bf1.yahoo.com with NNFMP; 25 Jun 2013 13:20:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 836557.41342.bm@omp1028.mail.bf1.yahoo.com Received: (qmail 75479 invoked by uid 60001); 25 Jun 2013 13:20:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1372166429; bh=LeDy49Evu9WQK4l7n0x3GMAA5It5xBn2e6aHnYWA0tQ=; 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=fW2pL2BacdDkXIFJMauhENjMTVNN50xK9zaOYBnfxWQRlHmBsS7AmMPxcTYzLEC+FccVqhT7jVhZxqlarN+D08nrxh+7kMr7yNvSWNZVaDarebrXlJcNbi0ET8UrXHFtEdEMib6qmBVKjdXSskoWX1VKaJufz2uLboivPvRA00Q= 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=ni76YYyPZTAuIpUkjEHkPO2H2qG8BqpTqu+gPphKB28YRYtbMo2qeuNjes8FuhrNzor5DWn0hHUU1WXMbs2172stp3Z5sQVihMSx3cmaMJ5pLcRmFZ7Gh9jxwYfv0G009znoXPVDh9VKJ5wK/RrdIpFShzQmHo9MBrQsMbheVS4=; X-YMail-OSG: zIlErPIVM1mByK9Zz6VJSqF88bmV3uTWK1Nt.hVsKOpUEPs 2fb4hQ50fiBu0gQB3AJQxiE0Z29kHR0iCuPBEiykHaR6p3x90cMX8bF3E2Y6 NdOInSCSWQ3dHCagUd6ZiMQ0F_XoBqQeZ_jwzjcJXe1unLdWcKyNfZJXEsXL IwKB8UhavcpM7uZ8Wto5bPIDrp_M.tkr.oIjIbiZzeOsKYcw2_QDxr8yNZwe 6Ga8cYf7gyTazUyXi5MKVl.XdcuBNI1w7g1VO8ktgwZOD2JKLfHe7nwHLxQG 0Ez3mgTJ69o91lj_8zYnwi3riAIb7K4T7YkIx3jden_aMnXV4lo76h2Y.ajm OKjGG6vRwcB1bINJaBGzcr5SYPW43eXesQnCKkuE_WK0TFTmoKvOfvsWkskU 4yo5kcVW7NiRKvCV5CpiQuz7JuExa1aMeXTVUqstSC_dkkLg8wFQWW6Hi7.e cdj.kSyBdeV3tcxI6FmwbUmqyzaZRrM3NEPAuL_b44WoVwZRhk914wcqmCfG KVq9SNxFpv9ajDm0u7jV0OcN11JzBS5uutWFo2aby4zKgh7XMjUaYgntnnCF wFXy.9jLQJ16Fanh_3cope_4G7tDaAyy6ighnyxpYShEaVYfEl8f2EDVU1Q1 UJdxOYeHLakoC4vRY36FShHBtHkOTY_Ox2ruUaJ_148_JhzBi Received: from [76.255.18.237] by web162901.mail.bf1.yahoo.com via HTTP; Tue, 25 Jun 2013 06:20:29 PDT X-Rocket-MIMEInfo: 002.001, QmVuIDxtaWRmaWVsZEBnbWFpbC5jb20.IHdyb3RlOgoKPiBQb3N0Z3JlU1FMIDkuMS4xIG9uIHg4Nl82NC1zdXNlLWxpbnV4LWdudSwgY29tcGlsZWQgYnkgZ2NjIChTVVNFIExpbnV4KSA0LjYuMiwgNjQtYml0CgpDb25zaWRlciBhcHBseWluZyB0aGUgbGF0ZXN0IGJ1ZyBmaXhlcyBmb3IgOS4xIC0tIHdoaWNoIHdvdWxkIGxlYXZlCnlvdSBzaG93aW5nIDkuMS45LgoKaHR0cDovL3d3dy5wb3N0Z3Jlc3FsLm9yZy9zdXBwb3J0L3ZlcnNpb25pbmcvCgo.IGRlZmF1bHRfc3RhdGlzdGljc190YXJnZXTCoMKgwqABMAEBAQE- X-Mailer: YahooMailWebService/0.8.148.554 References: <7D0DD8B1-D23C-4BBC-9AB2-20D81F0B4BB8@gmail.com> <9A75BF4B-0458-43E3-803B-E25BB1984A39@gmail.com> Message-ID: <1372166429.65996.YahooMailNeo@web162901.mail.bf1.yahoo.com> Date: Tue, 25 Jun 2013 06:20:29 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: incorrect row estimates for primary key join To: Ben , bricklen Cc: "pgsql-performance@postgresql.org list" In-Reply-To: <9A75BF4B-0458-43E3-803B-E25BB1984A39@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 0.7 (/) 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 Ben wrote: > PostgreSQL 9.1.1 on x86_64-suse-linux-gnu, compiled by gcc (SUSE Linux) 4= .6.2, 64-bit Consider applying the latest bug fixes for 9.1 -- which would leave you showing 9.1.9. http://www.postgresql.org/support/versioning/ > default_statistics_target=A0=A0=A0 | 50=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 | configuration file Why did you change this from the default of 100? > effective_cache_size=A0=A0=A0=A0=A0=A0=A0 | 5632MB=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 | configuration file How much RAM is on this machine?=A0 What else is running on it?=20 (Normally people set this to 50% to 75% of total RAM.=A0 Lower values discourage index usage in queries like your example.) Do you get a different plan if you set cpu_tuple_cost =3D 0.03?=A0 How about 0.05?=A0 You can set this just for a single connection and run explain on the query to do a quick check. -- 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