On 28 Mar 2006 17:01:45 -0800, Antimon <antimon@xxxxxxxxx> 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