Re: Mysterious performance of query because of plsql function in - Mailing list pgsql-performance

From CoL
Subject Re: Mysterious performance of query because of plsql function in
Date
Msg-id cc3r5g$210k$1@news.hub.org
Whole thread Raw
In response to Mysterious performance of query because of plsql function in where condition  ("Peter Alberer" <h9351252@obelix.wu-wien.ac.at>)
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: "Steinar H. Gunderson"
Date:
Subject: Odd sorting behaviour
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: inserting into brand new database faster than old database