This is by no means the world's best test (that would be re-writing an actual heavily loaded application), but I tried the same query as I did in Java yesterday in libpq.

Single threaded, the results were similar, seeing a 6.2% improvement this time. But when I started running several process concurrently (a shell script running starting the process 10 times in the background) the advantage of the prepared statement fell back to just a 2.5% improvement.

The execution times were nearly identical between the Java and C code (MacBook Pro 2.2Ghz, Postgres 8.2) with both doing 160 queries per second. The C code running concurrent connections went to 260/sec - which makes sense as the second core came into play. This postgres is used for development only and has had no tuning whatsoever, just out of the box.

So probably not worth the effort as much as I had hoped, but there is one interesting outcome:

JDBC does exactly what most people do not want to do for AOLserver and that is having the same bind variables / query parameters interface for each and every database, implemented in the driver. Even so, the performance between this and the libpq code is virtually the same. So whatever objection people might have regarding a single way to use bind variables in nsdb, performance should not be one of them.

Even though it is not my favourite way of doing it, two drivers (Postgres and Oracle) already have the same bind variable syntax, with the Oracle one following the native method and Postgres emulating it. So how about we forget prepared statements for now and at least make bind variables standard in nsdb, using the syntax used by Oracle and Postgres?

Cheers,
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