Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

copy.c

Blame
    • Tom Lane's avatar
      011b51cb
      Marginal hacking to improve the speed of COPY OUT. I had found in a bit of · 011b51cb
      Tom Lane authored
      profiling that CopyAttributeOutText was taking an unreasonable fraction of
      the backend run time (like 66%!) on the following trivial test case:
      
      $ time psql -c "copy (select repeat('xyzzy',50) from generate_series(1,10000000)) to stdout" regression >/dev/null
      
      The time is all being spent on scanning the string for characters to be
      escaped, which most of the time there aren't any of.  Some tweaking to take
      as many tests as possible out of the inner loop reduced the runtime of this
      example by more than 10%.  In a real-world case it wouldn't be as useful
      a speedup, but it still seems worth adding a few lines here.
      011b51cb
      History
      Marginal hacking to improve the speed of COPY OUT. I had found in a bit of
      Tom Lane authored
      profiling that CopyAttributeOutText was taking an unreasonable fraction of
      the backend run time (like 66%!) on the following trivial test case:
      
      $ time psql -c "copy (select repeat('xyzzy',50) from generate_series(1,10000000)) to stdout" regression >/dev/null
      
      The time is all being spent on scanning the string for characters to be
      escaped, which most of the time there aren't any of.  Some tweaking to take
      as many tests as possible out of the inner loop reduced the runtime of this
      example by more than 10%.  In a real-world case it wouldn't be as useful
      a speedup, but it still seems worth adding a few lines here.