V3 protocol is slower than V2

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: V3 protocol is slower than V2
Date: 2007-10-16 04:04:28
Message-ID: 20071016125435.9B0C.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi,

V3 protocol seems to be slower than V2 if we don't use prepared statement
together. I measured performance of protocols on 8.3beta using pgbench -S
with modification to use PQsendQueryParams and PQsendQueryPrepared
instead of PQsendQuery. (I'll send the patch to -patches shortly.)

[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.

There seems to be some inefficient behaviors in the handling of
V3 protocol or in libpq. Are there any TODO items here?

----
pg_ctl start -o "-c shared_buffers=1GB"
./pgbench -n -S -s50 -c16 -t100000 -M [V2|V3|PREPARE]
transaction type: SELECT only
scaling factor: 50
number of clients: 16
number of transactions per client: 100000
number of transactions actually processed: 1600000/1600000

sql mode: V2
tps = 19025.932203 (including connections establishing)
tps = 19036.285885 (excluding connections establishing)

sql mode: V3
tps = 16699.173521 (including connections establishing)
tps = 16707.135700 (excluding connections establishing)

sql mode: PREPARE
tps = 26629.710398 (including connections establishing)
tps = 26649.901658 (excluding connections establishing)

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2007-10-16 04:31:32 plpgsql: Plan type mismatch error
Previous Message Oleg Bartunov 2007-10-16 03:28:06 Re: 8.3 full text search docs

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2007-10-16 04:05:23 Avoid needless copy in nodeMaterial
Previous Message Tom Lane 2007-10-16 03:58:59 Re: Assertion failure with small block sizes