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 2C39AD1B345 for ; Fri, 2 Jul 2004 11:37:30 -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 74768-08 for ; Fri, 2 Jul 2004 14:37:32 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3F62BD1B2D9 for ; Fri, 2 Jul 2004 11:37:28 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i62EbRZ5069174 for ; Fri, 2 Jul 2004 14:37:27 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i62ENj0x066582 for pgsql-performance@postgresql.org; Fri, 2 Jul 2004 14:23:45 GMT From: CoL X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Mysterious performance of query because of plsql function in Date: Fri, 02 Jul 2004 16:23:44 +0200 Organization: Hub.Org Networking Services Lines: 35 Message-ID: References: <000001c46009$062e8260$5be0d089@ekelhardt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en In-Reply-To: <000001c46009$062e8260$5be0d089@ekelhardt> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/25 X-Sequence-Number: 7416 hi, Peter Alberer wrote: > Hi there, > > i have a problem with a query that uses the result of a plsql function > In > the where clause: > > SELECT > assignments.assignment_id, > assignments.package_id AS package_id, > assignments.title AS title, > COUNT(*) AS Count > FROM > assignments INNER JOIN submissions ON > (assignments.assignment_id=submissions.assignment_id) > WHERE > package_id=949589 AND > submission_status(submissions.submission_id)='closed' > GROUP BY > assignments.assignment_id, assignments.package_id, assignments.title > ORDER BY > assignments.title; > > Postgres seems to execute the function "submission_status" for every row > of > the submissions table (~1500 rows). what is submission_status actualy? \df submission_status Is the function submission_status called stable? C.