Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F31731337B69 for ; Wed, 22 Dec 2010 05:38:25 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 66205-01 for ; Wed, 22 Dec 2010 09:38:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) by mail.postgresql.org (Postfix) with ESMTP id 8FFBF1337B7D for ; Wed, 22 Dec 2010 05:38:17 -0400 (AST) Received: from localhost (mail2.mnc.ch [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 1B55B23050; Wed, 22 Dec 2010 09:38:16 +0000 (GMT) X-Virus-Scanned: amavisd-new at mnc.ch Received: from mail.mnc.ch ([127.0.0.1]) by localhost (mail2.mnc.ch [127.0.0.1]) (amavisd-new, port 10025) with LMTP id Y66eJSdbXLbO; Wed, 22 Dec 2010 09:38:15 +0000 (GMT) Received: from meuh.localdomain (62-2-77-204.static.cablecom.ch [62.2.77.204]) by mail.mnc.ch (Postfix) with ESMTP id A078223047; Wed, 22 Dec 2010 09:38:15 +0000 (GMT) Received: by meuh.localdomain (Postfix, from userid 1000) id 236921102A1; Wed, 22 Dec 2010 10:38:15 +0100 (CET) To: pasman =?utf-8?Q?pasma=C5=84ski?= Cc: pgsql-performance@postgresql.org Subject: Re: Query uses incorrect index References: From: Guillaume Cottenceau X-Hashcash: 1:21:101222:pasman.p@gmail.com::9WHFjkvOcqjPLzTs:00000000000000000000000000000000000000000006Dgu X-Hashcash: 1:21:101222:pgsql-performance@postgresql.org::lmpU6OK/u/VYxBZD:000000000000000000000000000001Bro Date: Wed, 22 Dec 2010 10:38:15 +0100 In-Reply-To: ("pasman =?utf-8?Q?pasma=C5=84ski=22's?= message of "Wed\, 22 Dec 2010 10\:22\:00 +0100") Message-ID: <874oa6w3js.fsf@meuh.mnc.lan> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201012/277 X-Sequence-Number: 41729 pasman pasma=C5=84ski writes: > Thanks for reply. > I tested random changes and query runs fastest after: > > set seq_page_cost =3D 0.1; > set random_page_cost =3D 0.1; > cpu_operator_cost =3D 0.01 If I'm correct, you're basically telling postgresql that your disk is unusually fast compared to your CPU. Even if some queries will run faster from a side-effect of these settings, you're likely to create other random problems... --=20 Guillaume Cottenceau