Search Postgresql Archives

Re: Function call costs for SQL and PLPgSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincenzo Romano <vincenzo.romano@xxxxxxxxx> writes:
> I need to create a huge SQL script to load 20+ M rows in a DB.
> I've been force to wrap the inserts into PG functions.
> I can write them in either SQl or PLPgSQL but don't know
> whether this can make a big difference as far as time of
> overall execution is concerned.

> Somewhere else I've been told that SQL function bodies get "inlined" 
> during execution. Is thus correct to consider SQL functions "faster"
> that the conterpart written in PLPgSQL?

Inlining only applies to simple-SELECT SQL functions (ie, pure
functions).  For what you're trying to do, I think plpgsql will
be faster as well as more flexible.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux