OSDN Git Service

COPY performance improvements. Avoid calling CopyGetData for each input
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Aug 2005 20:41:58 +0000 (20:41 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Aug 2005 20:41:58 +0000 (20:41 +0000)
commit9b29f9f3f86d0f03f61d8b9e449d5107615a3615
treedd0a702ac5ca5c44e29ec2b41e7baf2665da3dba
parent28d3ee477176e8e6847736c48e9346c5bcde73d1
COPY performance improvements.  Avoid calling CopyGetData for each input
character, tighten the inner loops of CopyReadLine and CopyReadAttribute,
arrange to parse out all the attributes of a line in just one call instead
of one CopyReadAttribute call per attribute, be smarter about which client
encodings require slow pg_encoding_mblen() loops.  Also, clean up the
mishmash of static variables and overly-long parameter lists in favor of
passing around a single CopyState struct containing all the state data.
Original patch by Alon Goldshuv, reworked by Tom Lane.
src/backend/commands/copy.c