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 E3B425282E for ; Fri, 29 Jul 2005 02:58:42 -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 40064-07 for ; Fri, 29 Jul 2005 05:58:32 +0000 (GMT) Received: from linuxworld.com.au (unknown [203.34.46.50]) by svr1.postgresql.org (Postfix) with ESMTP id 249BE52825 for ; Fri, 29 Jul 2005 02:58:30 -0300 (ADT) Received: from linuxworld.com.au (IDENT:swm@localhost.localdomain [127.0.0.1]) by linuxworld.com.au (8.13.2/8.13.2) with ESMTP id j6T5wOss011092; Fri, 29 Jul 2005 15:58:24 +1000 Received: from localhost (swm@localhost) by linuxworld.com.au (8.13.2/8.13.2/Submit) with ESMTP id j6T5wOfv011089; Fri, 29 Jul 2005 15:58:24 +1000 X-Authentication-Warning: linuxworld.com.au: swm owned process doing -bs Date: Fri, 29 Jul 2005 15:58:24 +1000 (EST) From: Gavin Sherry X-X-Sender: swm@linuxworld.com.au To: Matthew Schumacher Cc: pgsql-performance@postgresql.org Subject: Re: Performance problems testing with Spamassassin 3.1.0 In-Reply-To: <42E9BA2F.1090900@aptalaska.net> Message-ID: References: <42E80C28.2040608@aptalaska.net> <1122532023.25574.1.camel@localhost.localdomain> <42E9749F.6000709@aptalaska.net> <42E9BA2F.1090900@aptalaska.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/464 X-Sequence-Number: 13705 zOn Thu, 28 Jul 2005, Matthew Schumacher wrote: > Gavin Sherry wrote: > > > > > I had a look at your data -- thanks. > > > > I have a question though: put_token() is invoked 120596 times in your > > benchmark... for 616 messages. That's nearly 200 queries (not even > > counting the 1-8 (??) inside the function itself) per message. Something > > doesn't seem right there.... > > > > Gavin > > I am pretty sure that's right because it is doing word statistics on > email messages. > > I need to spend some time studying the code, I just haven't found time yet. > > Would it be safe to say that there isn't any glaring performance > penalties other than the sheer volume of queries? Well, everything relating to one message should be issued in a transaction block. Secondly, the initial select may be unnecessary -- I haven't looked at the logic that closely. There is, potentially, some parser overhead. In C, you could get around this with PQprepare() et al. It would also be interesting to look at the cost of a C function. Gavin