Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AE0FE9FBB83 for ; Fri, 9 Mar 2007 12:24:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 06515-07 for ; Fri, 9 Mar 2007 12:24:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 7224F9FBB48 for ; Fri, 9 Mar 2007 12:24:13 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 79E9B741E2; Fri, 9 Mar 2007 16:18:57 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 5B56E27401E; Fri, 9 Mar 2007 16:18:57 +0000 (GMT) Message-ID: <45F188F1.4010905@archonet.com> Date: Fri, 09 Mar 2007 16:18:57 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: =?UTF-8?B?TWV6ZWkgWm9sdMOhbg==?= Cc: pgsql-performance@postgresql.org Subject: Re: Deceiding which index to use References: <45F15F0F.8080403@telefor.hu> <45F1715E.1050000@archonet.com> <45F174CF.8010302@telefor.hu> <45F1775A.8030701@archonet.com> <45F179AB.7040000@telefor.hu> <45F17B70.60001@archonet.com> <45F180D2.5080201@telefor.hu> <45F182B7.30507@archonet.com> <45F18629.4000808@telefor.hu> In-Reply-To: <45F18629.4000808@telefor.hu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/204 X-Sequence-Number: 23609 Mezei Zoltán wrote: > Richard Huxton wrote: >> >> There is a cost to increasing the stats values, otherwise it'd >> already be set at 1000. In your case I'm not sure if 100-200 vs 8-9 >> messages is enough to skew things. Only one way to find out... >> > Well, I tried. The situation is: > > - when I look for a subscriber which the planner thinks to have more > messages --> it uses the index on crd - when I look for a subscriber > which the planner thinks to have less messages --> it uses the index > on subscriber_id > > I think that's OK, even if it still don't do what I really would like > to see it do :-) Well, it's decision about where the costs cross over will be in the other "cost" settings in postgresql.conf. The thing is, it's not worth tuning for just this one query, because you can easily end up running everything else more slowly. > Thanks for all your help, maybe I know a little bit more about > poostgresql than before. -- Richard Huxton Archonet Ltd