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

Re: plpgsql functions vs. embedded queries

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Wright, George" <George(dot)Wright(at)infimatic(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: plpgsql functions vs. embedded queries
Date: 2008-09-29 17:15:33
Message-ID: 1A05FF7F-A5F6-43B2-89BF-AB6C7C2352F0@pgedit.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Sep 29, 2008, at 9:50 AM, Wright, George wrote:

> Are funtions in plpgsql always slower than embedding sql queries in  
> string form in code like PHP?
> I ran several tests and they seemed to always perform that way. I  
> would have thought the pre-planning would have made them faster.
> Would re-writing the functions C make them faster than the embedded  
> queries?

I'd say no, they should not always be slower. Did you try preparing  
your PHP call to the function? Did you mark your function as STABLE if  
you are not modifying the database?


John DeSoi, Ph.D.





In response to

Responses

pgsql-novice by date

Next:From: Wright, GeorgeDate: 2008-09-29 17:45:17
Subject: Re: plpgsql functions vs. embedded queries
Previous:From: Wright, GeorgeDate: 2008-09-29 13:50:49
Subject: plpgsql functions vs. embedded queries

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