Re: Slowness of extended protocol - Mailing list pgsql-hackers

From Shay Rojansky
Subject Re: Slowness of extended protocol
Date
Msg-id CADT4RqB==eRKRABAAVTosHtpp--W7yxQGFW9f=Jr28EbJ0FigQ@mail.gmail.com
Whole thread Raw
In response to Re: Slowness of extended protocol  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: Slowness of extended protocol  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Re: Slowness of extended protocol  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Without re-using prepared statements or portals, extended protocol is
always slow because it requires more messages exchanges than simple
protocol. In pgbench case, it always sends parse, bind, describe,
execute and sync message in each transaction even if each transaction
involves identical statement ("SELECT 1" in your case).

See the manual for the protocol details.

I'm well aware of how the extended protocol works, but it seems odd for a 30% increase in processing time to be the result exclusively of processing 5 messages instead of just 1 - it doesn't seem like that big a deal (although I may be mistaken). I was imagining that there's something more fundamental in how the protocol or PostgreSQL state is managed internally, that would be responsible for the slowdown.

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: pg_dumping extensions having sequences with 9.6beta3
Next
From: Vladimir Sitnikov
Date:
Subject: Re: Slowness of extended protocol