Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 31B97632DF8 for ; Fri, 23 Apr 2010 10:10:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69394-02 for ; Fri, 23 Apr 2010 13:09:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by mail.postgresql.org (Postfix) with ESMTP id 3FD23632A2B for ; Fri, 23 Apr 2010 10:09:56 -0300 (ADT) Received: by bwz28 with SMTP id 28so10189986bwz.34 for ; Fri, 23 Apr 2010 06:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=zQ0pXG6NH9NFUxOzBm3A41ponBZvuyM7T0WjVPPR7I0=; b=Id2EaT5bxtbPkS/FwHHThS1FH4XnYiN+B5ZSgc33oM6pywHRSpED6aJtQplwJaVVuH MnqczfiOsPAnNSTPvsVVLGfLhNvjo582s3kE90SLEjkQLNdb7GS0/LGHeWgh6Y6ri+Pk toi9zKp4OqW+lGd7Skr18doRgKVcgfLzKb9kM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=r+NzoCh7Xcb/JhKX/sRg/YMdjIJu2ylkSkG0fDRMKajSOIjED8NN3NGuFyJcn6yvWp rZfO7te++CtvQVW/798tNR7af9aEco6VhraF1VVrYmPpLeZ0JG8K+oX/pORHBv8UIHyg 8FrFKNwjQYkmGKCFziCqlXjpeY4mnLP9rvLio= Received: by 10.239.134.72 with SMTP id 8mr2882hby.0.1272028194097; Fri, 23 Apr 2010 06:09:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.158.134 with HTTP; Fri, 23 Apr 2010 06:09:34 -0700 (PDT) In-Reply-To: References: <4BD0161A.4010908@dc.baikal.ru> <4BD0430C.1050308@2ndquadrant.com> <4BD10805.9060004@dc.baikal.ru> From: =?ISO-8859-1?Q?C=E9dric_Villemain?= Date: Fri, 23 Apr 2010 15:09:34 +0200 Message-ID: Subject: Re: Optimization idea To: Robert Haas Cc: Vlad Arkhipov , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/298 X-Sequence-Number: 38548 2010/4/23 Robert Haas : > On Thu, Apr 22, 2010 at 10:37 PM, Vlad Arkhipov wr= ote: >> I don't think this is just an issue with statistics, because the same >> problem arises when I try executing a query like this: > > I'm not sure how you think this proves that it isn't a problem with > statistics, but I think what you should be focusing on here, looking > back to your original email, is that the plans that are actually much > faster have almost as much estimated cost as the slower one. =A0Since > all your data is probably fully cached, at a first cut, I might try > setting random_page_cost and seq_page_cost to 0.005 or so, and > adjusting effective_cache_size to something appropriate. that will help worrect the situation, but the planner is loosing here I thi= nk. > > ...Robert > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org= ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --=20 C=E9dric Villemain