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 825F55282F for ; Thu, 4 Aug 2005 19:38:22 -0300 (ADT) 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 81498-09 for ; Thu, 4 Aug 2005 22:38:13 +0000 (GMT) Received: from larry.aptalaska.net (larry.aptalaska.net [64.186.96.3]) by svr1.postgresql.org (Postfix) with ESMTP id 4E09452800 for ; Thu, 4 Aug 2005 19:38:12 -0300 (ADT) Received: from [192.168.98.9] (rdbck-static-287.palmer.mtaonline.net [64.4.232.33]) (authenticated bits=0) by larry.aptalaska.net (8.13.4/8.13.4) with ESMTP id j74MbfVE015904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Aug 2005 14:37:42 -0800 Message-ID: <42F298B5.5010405@aptalaska.net> Date: Thu, 04 Aug 2005 14:37:41 -0800 From: Matthew Schumacher User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John A Meinel Cc: pgsql-performance@postgresql.org Subject: Re: Performance problems testing with Spamassassin 3.1.0 References: <42E9749F.6000709@aptalaska.net> <1122616211.5691.340.camel@lamb.mcmillan.net.nz> <42EA6966.8090402@aptalaska.net> <1122668371.5691.352.camel@lamb.mcmillan.net.nz> <19405.1122670917@sss.pgh.pa.us> <42EAA410.9010700@aptalaska.net> <27897.1122748133@sss.pgh.pa.us> <42EE8043.1050207@aptalaska.net> <42EE93F8.5010003@aptalaska.net> <20050801214931.GF60019@decibel.org> <42EE9D83.8000405@pobox.com> <42F1CE43.8040801@aptalaska.net> <15610.1123166222@sss.pgh.pa.us> <42F23FB6.5010405@aptalaska.net> <42F251F0.1070407@aptalaska.net> <42F26E2C.8010607@arbash-meinel.com> In-Reply-To: <42F26E2C.8010607@arbash-meinel.com> X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Bayes: Learn: unavailable X-Scanned-By: MIMEDefang 2.52 on 64.186.96.3 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200508/44 X-Sequence-Number: 13791 John A Meinel wrote: > Surely this isn't what you have. You have *no* loop here, and you have > stuff like: > AND > (bayes_token_tmp) NOT IN (SELECT token FROM bayes_token); > > I'm guessing this isn't your last version of the function. > > As far as putting the CREATE TEMP TABLE inside the function, I think the > problem is that the first time it runs, it compiles the function, and > when it gets to the UPDATE/INSERT with the temporary table name, at > compile time it hard-codes that table id. > > I tried getting around it by using "EXECUTE" which worked, but it made > the function horribly slow. So I don't recommend it. > > Anyway, if you want us to evaluate it, you really need to send us the > real final function. > > John > =:-> It is the final function. It doesn't need a loop because of the bayes_token_tmp function I added. The array is passed to it and it returns a record set so I can work off of it like it's a table. So the function works the same way it before, but instead of using SELECT intoken from TEMPTABLE, you use SELECT bayes_token_tmp from bayes_token_tmp(intokenary). I think this is more efficient than the create table overhead, especially because the incoming record set won't be to big. Thanks, schu