From: Tyler Hildebrandt <tyler@campbell-lange.net>
To: pgsql-performance@postgresql.org
Subject: Re: Query timing increased from 3s to 55s when used as a function instead of select
Date: Tue, 25 May 2010 14:41:00 +0100
Message-ID: <20100525134100.GA25592@campbell-lange.net> (raw)
In-Reply-To: <20100525103026.GA25341@a-kretschmer.de>
References: <20100525095943.GA18600@campbell-lange.net>
<20100525103026.GA25341@a-kretschmer.de>
> I think, your problem is here:
>
> SELECT INTO current_user * FROM
> fn_medirota_validate_rota_master(in_currentuser);
>
>
> The planner has no knowledge about how many rows this functions returns
> if he don't know the actual parameter. Because of this, this query
> enforce a seq-scan. Try to rewrite that to something like:
>
> execute 'select * from fn_medirota_validate_rota_master(' ||
> in_currentuser' || ')' into current_user
>
Thanks for your response. This doesn't seem to solve our issue, unfortunately.
As a side to that, we have the fn_medirota_validate_rota_master calls in a
large amount of our other functions that are running very well.
--
Tyler Hildebrandt
Software Developer
tyler@campbell-lange.net
Campbell-Lange Workshop
www.campbell-lange.net
020 7631 1555
3 Tottenham Street London W1T 2AF
Registered in England No. 04551928
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tyler@campbell-lange.net
Subject: Re: Query timing increased from 3s to 55s when used as a function instead of select
In-Reply-To: <20100525134100.GA25592@campbell-lange.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox