This is a discussion on Re: PREPARE and stuff within the Pgsql Performance forums, part of the PostgreSQL category; --> Well, that's not completely trivial => the plan might depend upon the concrete value of $1,$2 and $3. Andreas ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Well, that's not completely trivial => the plan might depend upon the concrete value of $1,$2 and $3. Andreas -- Ursprüngl. Mitteil. -- Betreff: [PERFORM] PREPARE and stuff Von: PFC <lists@peufeu.com> Datum: 23.06.2007 21:31 Suppose a web application with persistent database connections. I have some queries which take longer to plan than to execute ! I with there was a way to issue a PREPARE (like "PERSISTENT PREPARE"). Now all Postgres connections would know that prepared statement foo( $1, $2, $3 ) corresponds to some SQL query, but it wouldn't plan it yet. Just like a SQL function. When invoking EXECUTE foo( 1,2,3 ) on any given connection the statement would get prepared and planned. Then on subsequent invocations I'd just get the previously prepared plan. Is this planned ? ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| > Well, that's not completely trivial => the plan might depend upon the > concrete value of $1,$2 and $3. When you use PREPARE, it doesn't. I could live with that. The purpose of this would be to have a library of "persistent prepared statements" (just like lightweight functions) for your application, and maximize the performance of persistent connections. ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |