forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2e4127b
committed
Refactor COPY TO to use format callback functions.
This commit introduces a new CopyToRoutine struct, which is a set ofcallback routines to copy tuples in a specific format. It also makesthe existing formats (text, CSV, and binary) utilize these formatcallbacks.This change is a preliminary step towards making the COPY TO commandextensible in terms of output formats.Additionally, this refactoring contributes to a performanceimprovement by reducing the number of "if" branches that need to bechecked on a per-row basis when sending field representations in textor CSV mode. The performance benchmark results showed ~5% performancegain 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.com1 parent555960a commit2e4127b
File tree
3 files changed
+355
-141
lines changed- src
- backend/commands
- include/commands
- tools/pgindent
3 files changed
+355
-141
lines changed0 commit comments
Comments
(0)