Skip site navigation (1) Skip section navigation (2)

Re: Query timing increased from 3s to 55s when used as afunction instead of select

From: Tyler Hildebrandt <tyler(at)campbell-lange(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query timing increased from 3s to 55s when used as afunction instead of select
Date: 2010-05-25 13:41:00
Message-ID: 20100525134100.GA25592@campbell-lange.net (view raw or flat)
Thread:
Lists: pgsql-performance
> 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(at)campbell-lange(dot)net

Campbell-Lange Workshop
www.campbell-lange.net
020 7631 1555
3 Tottenham Street London W1T 2AF
Registered in England No. 04551928

In response to

Responses

pgsql-performance by date

Next:From: Juan Pablo Sandoval RiveraDate: 2010-05-25 14:04:07
Subject: tunning pgsql 7.3.7 over RHEL 4.0 32 x86 (2.6.9-5ELsmp)
Previous:From: Andres FreundDate: 2010-05-25 10:41:58
Subject: Re: performance of temporary vs. regular tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group