pgsql: Improve performance of SendRowDescriptionMessage.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve performance of SendRowDescriptionMessage.
Date: 2017-10-12 00:28:21
Message-ID: E1e2RML-0002do-Lc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Improve performance of SendRowDescriptionMessage.

There's three categories of changes leading to better performance:
- Splitting the per-attribute part of SendRowDescriptionMessage into a
v2 and a v3 version allows avoiding branches for every attribute.
- Preallocating the size of the buffer to be big enough for all
attributes and then using pq_write* avoids unnecessary buffer
size checks & resizing.
- Reusing a persistently allocated StringInfo for all
SendRowDescriptionMessage() invocations avoids repeated allocations
& reallocations.

Author: Andres Freund
Discussion: https://postgr.es/m/20170914063418.sckdzgjfrsbekae4@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4c119fbcd49ba882791c7b99a1e934b985468e9f

Modified Files
--------------
src/backend/access/common/printtup.c | 146 ++++++++++++++++++++++++++---------
src/backend/tcop/postgres.c | 35 +++++++--
src/include/access/printtup.h | 4 +-
3 files changed, 138 insertions(+), 47 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-10-12 02:11:02 pgsql: Temporary attempt at a workaround for further MSVC restrict buil
Previous Message Andres Freund 2017-10-12 00:13:20 Re: pgsql: Add configure infrastructure to detect support for C99's restric

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-10-12 00:46:23 Re: 64-bit queryId?
Previous Message Andres Freund 2017-10-12 00:13:20 Re: pgsql: Add configure infrastructure to detect support for C99's restric