CREATE FUNCTION ... performance boost? - Mailing list pgsql-general

From Jan Danielsson
Subject CREATE FUNCTION ... performance boost?
Date
Msg-id 46852C4B.4070809@gmail.com
Whole thread Raw
Responses Re: CREATE FUNCTION ... performance boost?  ("Merlin Moncure" <mmoncure@gmail.com>)
Re: CREATE FUNCTION ... performance boost?  ("Merlin Moncure" <mmoncure@gmail.com>)
Re: CREATE FUNCTION ... performance boost?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hello all,

   In order to speed up commonly used queries, I use prepared
statements. I assume that 'prepare' tells some database query planner to
take a look at a query, and do all preparations for it, then store those
preparations somewhere for when it's needed.

   When I use CREATE FUNCTION to create a function, does that also get
"planned" automatically (plsql, specifically). My gut feeling is that it
doesn't (mainly since it can be any external language).

   The reason I'm asking is because I'd like to have permanently stored
"prepared" statements in a database. On even intervals, I connect to it,
and perform a number of queries. Many of them are the same statements
being run over and over. And these prepared statements really are "hard
coded", so they would do fine in my database initialization script.

   I assume that "functions" aren't what I am looking for.. But is is
possible to store preparations some way so they survive past
connection/disconnections?


- --
Kind regards,
Jan Danielsson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iD8DBQFGhSxLuPlHKFfKXTYRCjb0AJ4utz24vsbwNkU0dGMpPyqg/c7azACfW+b7
0Ecy+yD3ayrvR+C+B8G9shQ=
=NFfn
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: db replication
Next
From: "Merlin Moncure"
Date:
Subject: Re: CREATE FUNCTION ... performance boost?