Skip to content

Commit 2e4127b

Browse files
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 <[email protected]> Reviewed-by: Masahiko Sawada <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Reviewed-by: Andres Freund <[email protected]> Reviewed-by: Tomas Vondra <[email protected]> Reviewed-by: Junwang Zhao <[email protected]> Discussion: https://postgr.es/m/[email protected]
1 parent 555960a commit 2e4127b

File tree

3 files changed

+355
-141
lines changed

3 files changed

+355
-141
lines changed

0 commit comments

Comments
 (0)