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

function slower than the same code in an sql file

From: CS DBA <cs_dba(at)consistentstate(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: function slower than the same code in an sql file
Date: 2011-10-28 04:54:47
Message-ID: 4EAA3597.3020202@consistentstate.com (view raw or flat)
Thread:
Lists: pgsql-performance
Hi All ;

I have code that drops a table, re-create's it (based on a long set of 
joins) and then re-creates the indexes.

It runs via psql in about 10 seconds.  I took the code and simply 
wrapped it into a plpgsql function and the function version takes almost 
60 seconds to run.

I always thought that functions should run faster than psql... am I wrong?

Thanks in advance

-- 
---------------------------------------------
Kevin Kempter       -       Constent State
A PostgreSQL Professional Services Company
           www.consistentstate.com
---------------------------------------------


Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2011-10-28 05:10:08
Subject: Re: function slower than the same code in an sql file
Previous:From: Josh BerkusDate: 2011-10-28 02:42:01
Subject: Re: PostgreSQL 9.0.4 blocking in lseek?

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