Re: V3 protocol is slower than V2

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: V3 protocol is slower than V2
Date: 2007-10-16 05:11:20
Message-ID: 20071016135536.9B0F.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2007-10-16 05:15:20 Re: plpgsql: Plan type mismatch error
Previous Message Pavel Stehule 2007-10-16 05:08:20 Re: FOUND with EXECUTE

Browse pgsql-patches by date

  From Date Subject
Next Message Jacky Leng 2007-10-16 10:30:10 Why copy_relation_data only use wal when WAL archiving is enabled
Previous Message Neil Conway 2007-10-16 04:55:35 Re: Avoid needless copy in nodeMaterial