Re: PostgreSQL client api

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: Antimon <antimon(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL client api
Date: 2006-03-29 14:22:09
Message-ID: b42b73150603290622yab4a41cm8de347d336e9d159@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28 Mar 2006 17:01:45 -0800, Antimon <antimon(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-03-29 14:24:42 Re: Connecting
Previous Message Bob Pawley 2006-03-29 14:08:44 Connecting