Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGvrd-00054O-Sh for pgsql-performance@arkaria.postgresql.org; Tue, 03 Sep 2013 19:02:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VGvrd-0007j5-4L for pgsql-performance@arkaria.postgresql.org; Tue, 03 Sep 2013 19:02:09 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGvra-0007ea-7G for pgsql-performance@postgresql.org; Tue, 03 Sep 2013 19:02:06 +0000 Received: from nm50-vm8.bullet.mail.bf1.yahoo.com ([216.109.115.239]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGvrW-0006uN-B5 for pgsql-performance@postgresql.org; Tue, 03 Sep 2013 19:02:05 +0000 Received: from [66.196.81.170] by nm50.bullet.mail.bf1.yahoo.com with NNFMP; 03 Sep 2013 19:02:00 -0000 Received: from [98.139.212.213] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 03 Sep 2013 19:02:00 -0000 Received: from [127.0.0.1] by omp1022.mail.bf1.yahoo.com with NNFMP; 03 Sep 2013 19:02:00 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 222236.72910.bm@omp1022.mail.bf1.yahoo.com Received: (qmail 79329 invoked by uid 60001); 3 Sep 2013 19:02:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1378234920; bh=3EIW0Xf6TlWNA1r63Yieca5uc1xkcitfKGqHp3wPxkE=; 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=UfsxNN1ulqvhwpFfEP5Ab69zmjsmQPRMs3/mgg8LorzyyMetokvFGgxbfA1BGfAnabW6Ce9bpOq4VZpwAq3tLOGebVcKAt5lh95tLUh4ppWvCnqr0VmbnHYvdgRWVgvnFQu+okm10TEZreZnipY65hKrR6tMKggpN7p8MkBCZWY= 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=bkkhzTMxjzTCuvg1gQXtSJND7fgXSAQpTx5pJo6rr7H4airoLmojJCRqUdQFO0LlxSImCNKGg/2Tz1+Ql1PV68bIB7zSPN3k2zEC6PkUcnSWNLDnDSrphkCffkVoLEaiUmhe1lVC2qalyVrW0jelwefloMBRwrGNA+suvzvsK3I=; X-YMail-OSG: OW9LovIVM1knpBX7DxfX0jrK2C9zhvJmIiYTPq.pOpQh6ED UhAwEN.DA0broJnj4EEcb3Us1KYpdRdGBeIdynOHewa0ZpWHlw0KLDYzFsA1 Bh0IATodFW2zkFWN_Tx6cSLm7sMIg5zgqhouwou7kViOXYiqrG7QX1LXRgtn 3qw6NsFaba1ah2Z.uaO_Lv_ZKZfp8pTOr2t.FZPkA73jHZutSNgn7_DUsL1y sAArMrXHueeNuxFzBRcvvwR9vvvOwy4jQ4nCswojpVh5IZfBUNVvNFkFr9Hg 8N_j9YL_ia7V_UzN4i8N2yXEhuDi74ucBQhzabLTjXWFybkVcYUF_imfjF3x .urlCBOMllC2_yvNVYJYAOI5.mTk72WLJWpivR65LQW04tSTS7id7hgdaHdD n4YSIyjxVw.z1DAYafaAcrK8M7MOuXkcPza_b1NFQs.zQVlFNhqH0XQCTzAe H3VjABqQ0cfWX63VG_QtDdmmwYUgI.UzaSJt3p98D9DzVyI7h4q1yaA_7QRH p2AWrIaJrIRBn67I3uAZUX.qCOUpI7__HNMzKdA6B45c30xEZJQ72MC9g_Y8 w6FuUS8xJiBiBKNq6i9tXu9UzamuCjCBYylfO.9NCm4o0PUwqugjamwN038K 62gHrJv_aPMmkEJlEIBIC.mHTrWt5loPBDOtpZi4KBEczq5vMhfpb5srsosZ XxCurkdfA9VnA7AnfV0fRwwFDLarnMlPw_tml Received: from [76.255.18.237] by web162906.mail.bf1.yahoo.com via HTTP; Tue, 03 Sep 2013 12:02:00 PDT X-Rocket-MIMEInfo: 002.001, VG9yc3RlbiBGw7ZydHNjaCA8dG9yc3Rlbi5mb2VydHNjaEBnbXgubmV0PiB3cm90ZToKCj4gSXMgdGhlcmUgYW4gb3RoZXIgd2F5IHRvIG1ha2UgdGhlIHBsYW5uZXIgdXNlIGdlbmVyYXRlIHRoZSAxc3QKPiBwbGFuPwoKVGhlIHBsYW5uZXIgY29zdCBmYWN0b3JzIGFyZSBiYXNlZCBvbiB0aGUgYXNzdW1wdGlvbiB0aGF0IGEKbW9kZXJhdGUgcGVyY2VudGFnZSBvZiByYW5kb20gcGFnZSByZWFkcyB3aWxsIG5lZWQgdG8gYWN0dWFsbHkgZ28Kb3V0IHRvIGRpc2suwqAgSWYgYSBoaWdoIHBlcmNlbnRhZ2Ugb2YBMAEBAQE- X-Mailer: YahooMailWebService/0.8.156.576 References: <5224ED90.7030808@gmx.net> Message-ID: <1378234920.66126.YahooMailNeo@web162906.mail.bf1.yahoo.com> Date: Tue, 3 Sep 2013 12:02:00 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: planner parameters To: =?iso-8859-1?Q?Torsten_F=F6rtsch?= , "pgsql-performance@postgresql.org" In-Reply-To: <5224ED90.7030808@gmx.net> 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 Torsten F=F6rtsch wrote: > Is there an other way to make the planner use generate the 1st > plan? The planner cost factors are based on the assumption that a moderate percentage of random page reads will need to actually go out to disk.=A0 If a high percentage of pages are in cache, you may want to reduce random_page_cost to something closer to (or even equal to) seq_page_cost.=A0 I generally find I get better plans if I raise cpu_tuple_cost to 0.03.=A0 effective_cache_size should generally be between 50% and 75% of machine RAM.=A0 If these changes (or others of their ilk) cause costs to be estimated in a way which more nearly matches reality, better plans will be chosen. > Why does it generate the 2nd plan at all? It has the lowest estimated cost, based on your memory configuration and cost factors. > Does the planner take into account what is currently present in > shared memory? No.=A0 If you search the archives you can probably find previous discussions of whether it would be a good idea to do so; the consensus has been that it would not be. If you have further performance-related questions, please review this page so that you can provide enough information to allow people to give the most helpful advice: http://wiki.postgresql.org/wiki/SlowQueryQuestions -- Kevin Grittner EDB: 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