pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CS DBA <cs_dba@consistentstate.com>
To: pgsql-performance@postgresql.org
Subject: function slower than the same code in an sql file
Date: Thu, 27 Oct 2011 22:54:47 -0600
Message-ID: <4EAA3597.3020202@consistentstate.com> (raw)

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
---------------------------------------------




view thread (8+ messages)  latest in thread

Message-ID: <4EAA3597.3020202@consistentstate.com>
Permalink:  ../4EAA3597.3020202@consistentstate.com/
Also on:    postgresql.org/message-id/4EAA3597.3020202@consistentstate.com

 · 

reply

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: cs_dba@consistentstate.com
  Subject: Re: function slower than the same code in an sql file
  In-Reply-To: <4EAA3597.3020202@consistentstate.com>

* 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