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