[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix
- From: Florian Weimer <fw@...>
- Date: Wed, 03 Feb 2010 20:29:02 +0100
* Joshua Jensen:
> Sure, but I deal in lots of binary data. While I don't understand the
> network protocols of the databases I use, there is a much better
> chance my binary data bound to the prepared statement is going to be
> handled in a much more optimal way than escaping the binary and
> compiling/sending it that way.
The performance advantage is especially noticeable with PostgreSQL
because of the way embedded binary data has to be encoded in queries.
(But the binding author needs to know about this and add a flag to
pass unquoted binary data parameters over the wire.)
> Plus, with prepared statements, you don't have to deal with escaping
> anything. It's a double win... ease of use and performance.
It's less clear if prepared statements are a win performancewise (as
opposed to mere parametrized queries). Some loads only benefit if you
pre-plan queries (without knowledge of the actual parameter values),
others suffer tremendously compared to non-prepared statements because
those additional constants (coming from parameters) really help the
optimizers to choose better plans.
As a general rule, I tend to avoid prepared statements, except for
bulk loads.
- References:
- when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Vasanta
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Florian Weimer
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Vasanta
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, noel frankinet
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Florian Weimer
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Vasanta
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Florian Weimer
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Joshua Jensen
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Petite Abeille
- Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix, Joshua Jensen