Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 672199FBDA8 for ; Fri, 30 Mar 2007 08:35:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 91757-01 for ; Fri, 30 Mar 2007 08:35:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by postgresql.org (Postfix) with ESMTP id 2859E9FBDF7 for ; Fri, 30 Mar 2007 08:35:55 -0300 (ADT) Received: from mail.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id l2UBYfR07044; Fri, 30 Mar 2007 13:34:41 +0200 Received: from [127.0.0.1] (accesspoint.mm.eutelsat.org [194.214.173.4]) by mail.mm.eutelsat.org (8.13.1/8.13.1) with ESMTP id l2UBcRLA012868; Fri, 30 Mar 2007 13:38:28 +0200 Message-ID: <460CF5E4.3090005@bigfoot.com> Date: Fri, 30 Mar 2007 13:35:00 +0200 From: Gaetano Mendola User-Agent: Thunderbird 2.0.0.0pre (Windows/20070328) MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" CC: Michael Fuhr Subject: Re: Wrong plan sequential scan instead of an index one References: <460CD941.6080303@bigfoot.com> <460CE19A.3060909@bigfoot.com> <20070330104611.GA1540@winnie.fuhr.org> <20070330105534.GA1737@winnie.fuhr.org> In-Reply-To: <20070330105534.GA1737@winnie.fuhr.org> X-Enigmail-Version: 0.95b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on mail.mm.eutelsat.org X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/446 X-Sequence-Number: 23851 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Fuhr wrote: > On Fri, Mar 30, 2007 at 04:46:11AM -0600, Michael Fuhr wrote: >> Have you tried increasing the statistics target on l_pvcp.value? >> I ran your queries against canned data in 8.2.3 and better statistics >> resulted in more accurate row count estimates for this and other >> parts of the plan. I don't recall if estimates for non-leading-character >> matches in earlier versions can benefit from better statistics. > > This might work only in 8.2. I see the following in the Release Notes: > > * Improve the optimizer's selectivity estimates for LIKE, ILIKE, > and regular expression operations (Tom) I will try same select on a 8.2 ( that one was a 8.1 ) and I'll let you know. Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGDPXk7UpzwH2SGd4RAsQcAKCs5sh3mYuE2TMdbtdxxgSOs989JACglT1H 44s1hJZJ5upBzIPwLigoxa4= =Aas2 -----END PGP SIGNATURE-----