Re: pgsql vs mysql - Mailing list pgsql-general

From Merlin Moncure
Subject Re: pgsql vs mysql
Date
Msg-id b42b73150607111231m39e4d2d2pa74650d4207a5a15@mail.gmail.com
Whole thread Raw
In response to Re: pgsql vs mysql  (Guido Neitzer <guido.neitzer@pharmaline.de>)
List pgsql-general
On 7/11/06, Guido Neitzer <guido.neitzer@pharmaline.de> 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

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: Re: encoding bug or feature?
Next
From: Tom Lane
Date:
Subject: Re: troubleshooting 8.1.2