]> granicus.if.org Git - postgresql/commit
Improve performance of SendRowDescriptionMessage.
authorAndres Freund <andres@anarazel.de>
Wed, 11 Oct 2017 23:49:31 +0000 (16:49 -0700)
committerAndres Freund <andres@anarazel.de>
Thu, 12 Oct 2017 00:23:23 +0000 (17:23 -0700)
commit4c119fbcd49ba882791c7b99a1e934b985468e9f
tree3ab2f089ccdeac4a38e94552b6edf9557b3c7793
parentcff440d368690f94fbda1a475277e90ea2263843
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
src/backend/access/common/printtup.c
src/backend/tcop/postgres.c
src/include/access/printtup.h