Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 7ED3A2E0043 for ; Wed, 16 Apr 2008 15:58:18 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 30825-07 for ; Wed, 16 Apr 2008 15:58:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id BB9872E002E for ; Wed, 16 Apr 2008 15:58:06 -0300 (ADT) Received: from localhost (or-69-34-217-90.sta.embarqhsd.net [69.34.217.90]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m3GIwcHR027580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Apr 2008 11:58:39 -0700 Date: Wed, 16 Apr 2008 11:58:08 -0700 From: "Joshua D. Drake" To: "Gavin M. Roy" Cc: "Tom Lane" , pgsql-performance@postgresql.org Subject: Re: SQL Function Slowness, 8.3.0 Message-ID: <20080416115808.60e2d984@commandprompt.com> In-Reply-To: References: <8328.1208358587@sss.pgh.pa.us> Organization: Command Prompt, Inc. X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Wed, 16 Apr 2008 11:58:39 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/208 X-Sequence-Number: 29701 On Wed, 16 Apr 2008 14:44:40 -0400 "Gavin M. Roy" wrote: > After detailed examination of pg_stat_user_indexes usage, it's clear > that the functions don't use the same indexes. I've casted > everything to match the indexes in the SQL function, to no success. > Any suggestions on next steps? Maybe for 8.4 we could find a way to > explain analyze function internals ;-) > Gavin To quote Tom in the appropriate bottom posting method: > > > > Without a specific example this discussion is pretty content-free, > > but in general SQL functions face the same hazards of bad > > parameterized plans as plpgsql functions do. > > > > regards, tom lane > > Sincerely, Joshua D. Drake -- The PostgreSQL Company since 1997: http://www.commandprompt.com/ PostgreSQL Community Conference: http://www.postgresqlconference.org/ United States PostgreSQL Association: http://www.postgresql.us/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate