Re: PostgreSQL client api - Mailing list pgsql-general

From Merlin Moncure
Subject Re: PostgreSQL client api
Date
Msg-id b42b73150603290622yab4a41cm8de347d336e9d159@mail.gmail.com
Whole thread Raw
In response to PostgreSQL client api  ("Antimon" <antimon@gmail.com>)
List pgsql-general
On 28 Mar 2006 17:01:45 -0800, Antimon <antimon@gmail.com> wrote:
> Nearly 3 times slower even w/o any table queries. But i could not
> reproduce this by writing stored procs on both which selects 0-10000 in
> a loop to a variable. results were almost same.
> (I tried pg_ and mysqli_ functions too, results were not too different)
>
> Is it mysql client libraries performs better? Or postgre stored procs
> are 3x faster? I cannot understand, since there is not even an io
> operation or any query planning stuff, what is the cause of this?

Yes, it is the case that raw select performance for pgsql  drastically
improves with prepares statements as much as 2-3x.  In my experience
postgresql is just a bit faster with prepared statements and
substantially slower without.  There is a little bit of pain in
setting them up properly in a pooling web environment but it is worth
it if you want top performance.

Does anybody know if php uses the parameterized flavors of the C API?
That's another huge optimization over PQexec.

I agree with Jim in that it't probably fast enough anyways.

Merlin

pgsql-general by date:

Previous
From: Bob Pawley
Date:
Subject: Connecting
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Connecting