pgsql: Improve performance of SendRowDescriptionMessage.
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Date: 2017-10-12T00:28:21Z
Lists: 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(-)
Commits
-
Force "restrict" not to be used when compiling with xlc.
- d133982d598c 11.0 landed
-
Rely on sizeof(typename) rather than sizeof(variable) in pqformat.h.
- 5229db6c6f92 11.0 landed
-
Use C99 restrict via pg_restrict, rather than restrict directly.
- 91d5f1a4a3e8 11.0 cited
-
Improve performance of SendRowDescriptionMessage.
- 4c119fbcd49b 11.0 cited
-
Partially flatten struct tupleDesc so that it can be used in DSM.
- c6293249dc17 11.0 cited
-
Remove useless duplicate inclusions of system header files.
- 9e3755ecb2d0 10.0 cited