On 7/11/06, Guido Neitzer <guido.neitzer@xxxxxxxxxxxxx> wrote:
On 11.07.2006, at 19:36 Uhr, Merlin Moncure wrote: > As to preparing > statements, I agree in principle although I don't know if that is a > good argument not to make the non-paramaterized interface more > powerful. It is not, as prepared statements have the problem that they are only optimized once and very generically and without actual knowledge of the parameter content, this is just useless.
there is some confusion (not necessarily by you) between paramaterized and prepared statements. parameterized is when the query parameters are separate from the query string itself, you can do this with or without preparing them. parameterizing statements is basically always a good thing...you get something for nothing. preparing can work great or not depending on what you are trying to do. If they work then can cut as much of 50% of the query time and if they dont work...well you know what happens. I can vouch for this, for example I like to parameterize the limit clause but this can confuse the planner. Still, overall, when used carefully and properly, they can supercharge your server. merlin