Re: V3 protocol is slower than V2 - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: V3 protocol is slower than V2
Date
Msg-id 20071016135536.9B0F.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
In response to Re: V3 protocol is slower than V2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> >   [V2]  PQsendQuery (V2; original)
> >   [V3]  PQsendQueryParams (V3)
> >   [V3P] PQsendQueryPrepared (V3 with prepared statements)
> 
> > V3 was 12% slower than V2, and V3P was 40% faster than V2.
> 
> Those aren't really comparable, because the functionality is different.
> Did you check plain PQSendQuery on both V2 and V3?

Oops, I called 'simple query' V2. All of my tests used V3 protocol.
The results need to be read as:

PQsendQuery = (simple query) vs.
PQsendQueryParams = (parse + bind + describe + execute + sync)

If the latter is slower than the former, the another version of
PQsendQueryParams, that fills parameters into SQL and uses simple-query,
might be considerable for performance. For example in Java, using
PreparedStatement class with V2 protocol.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: FOUND with EXECUTE
Next
From: "Pavel Stehule"
Date:
Subject: Re: plpgsql: Plan type mismatch error