On 17/04/2008, at 1:18 PM, Jeff Rogers wrote:
Do you have test code and results to back this up?
I though I would give it a go. It is not the same, but I used Java because it is so easy to use prepared statements. I took the "dellstore2" database from the postgres sample database project and did a relatively simple query on a small data set:

select *
from customers c
join orders o on o.customerid = c.customerid
join orderlines l on o.orderid = l.orderid
where c.customerid = ?

1000 invocation with a random customerid between 0 and 20,000. (single connection and thread) Obviously I ran these several times each and took the average execution time. This to avoid the situation where the computer was doing something else during one of the runs influencing the results.

The prepared version gained 6.7% in performance.

Unfortunately, this only proves that this Java sample is faster using prepared statements, not where those gains are made. I find it safe to assume at least some of those gains are from Postgres, probably making it worth creating at least a prototype for it in AOLserver where it will also be easy to put a load tester against it and see what the gains are in a real (multithreaded) situation.

Hmmm, come to think of it, I can do this test natively in libpq. I'll try and do that soon.

Bas.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to