X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 67C84563A7 for ; Wed, 9 Mar 2005 11:21:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 75047-06 for ; Wed, 9 Mar 2005 11:21:15 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id 46D4156378 for ; Wed, 9 Mar 2005 11:21:13 +0000 (GMT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id j29CODA24789; Wed, 9 Mar 2005 13:24:14 +0100 Received: from [127.0.0.1] (accesspoint.mm.eutelsat.org [194.214.173.4]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id j29BLBR11739; Wed, 9 Mar 2005 12:21:11 +0100 Message-ID: <422EDC19.4080105@bigfoot.com> Date: Wed, 09 Mar 2005 12:20:57 +0100 From: Gaetano Mendola User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John A Meinel Cc: Gaetano Mendola , =?UTF-8?B?TWFya3VzIEJlcnRoZWF1?= =?UTF-8?B?IOKYrQ==?= , pgsql-performance@postgresql.org Subject: Re: pl/pgsql faster than raw SQL? References: <1110284432.4905.18.camel@dicaprio.akademie1.de> <422E4948.3090208@bigfoot.com> <422E511B.40102@arbash-meinel.com> In-Reply-To: <422E511B.40102@arbash-meinel.com> X-Enigmail-Version: 0.90.1.1 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.176 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/161 X-Sequence-Number: 10866 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John A Meinel wrote: > That sounds more like you had bad statistics on the field1 column, which > caused postgres to switch from a seqscan to an index scan, only there > were so many rows with field1='New' that it actually would have been > faster with a seqscan. The field1 was a calculated field and with the filter "='New'" postgres was executing that function on more rows than without filter. Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCLtwZ7UpzwH2SGd4RAhU5AJwMeFWwIO/UfdU0QTDo+FTCxPhqYACfYNVl 1yBUEObhZhUDnNDXdsJ/bi0= =xc8U -----END PGP SIGNATURE-----