Forum OpenACS Development: Re: PREPARE considered beneficial

Collapse
Posted by Mark Aufflick on
Mmm PQexecParams looks great - couldn't the nsd driver do a version check and use it if it's available?

Anyway, it's not needed for using prepare statements, it will just take the hassle of quoting off our driver for prepared and normal statements.

The case I am using is using a lot of fairly simple statements as well. i am imagining we can get a good speed boost for permissions type queries and complex queries like the crazy ones used by news aggregator.

RE: sorting - maybe you could have a fixed (unsorted) query prepared, and use it as a subselect within a select * from (execute foo) order by foo desc - I haven't tested that form though.

I haven't heard back on the postgres performance list about the effect or usefulness of prepare with queries in pgplsql - I would imagine that internally they would be "prepared" when the plpgsql is compiled, but I don't know.