diff options
author | Masahiko Sawada <msawada@postgresql.org> | 2025-02-27 15:03:52 -0800 |
---|---|---|
committer | Masahiko Sawada <msawada@postgresql.org> | 2025-02-27 15:03:52 -0800 |
commit | 2e4127b6d2d8f3a9d67a21d1905703d5be46970c (patch) | |
tree | a910ea8e9cbcec1243a4ae499f8b423c13b81753 /src/backend/utils/adt/pgstatfuncs.c | |
parent | 555960a0fbf0590a744f36e90e69e2501dc06146 (diff) | |
download | postgresql-2e4127b6d2d8f3a9d67a21d1905703d5be46970c.tar.gz postgresql-2e4127b6d2d8f3a9d67a21d1905703d5be46970c.zip |
Refactor COPY TO to use format callback functions.
This commit introduces a new CopyToRoutine struct, which is a set of
callback routines to copy tuples in a specific format. It also makes
the existing formats (text, CSV, and binary) utilize these format
callbacks.
This change is a preliminary step towards making the COPY TO command
extensible in terms of output formats.
Additionally, this refactoring contributes to a performance
improvement by reducing the number of "if" branches that need to be
checked on a per-row basis when sending field representations in text
or CSV mode. The performance benchmark results showed ~5% performance
gain in text or CSV mode.
Author: Sutou Kouhei <kou@clear-code.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/20231204.153548.2126325458835528809.kou@clear-code.com
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
0 files changed, 0 insertions, 0 deletions