Improve performance of SendRowDescriptionMessage.
Andres Freund <andres@anarazel.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/common/printtup.c | modified | +108 −38 |
| src/backend/tcop/postgres.c | modified | +28 −7 |
| src/include/access/printtup.h | modified | +2 −2 |
Discussion
- SendRowDescriptionMessage() is slow for queries with a lot of columns 29 messages · 2017-09-14 → 2017-10-11