Invent an assign-hook mechanism for psql variables similar to the one
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Aug 2006 15:19:51 +0000 (15:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Aug 2006 15:19:51 +0000 (15:19 +0000)
commit9e28580eceb6af4d0fda5aa9a869cd9354e56733
tree47a3db2b4e9ccfd8e923d0d1d3d5e62646b0efe6
parent68e937e6ea6246673c74e1cebd2a7c153f2651f0
Invent an assign-hook mechanism for psql variables similar to the one
existing for backend GUC variables, and use this to eliminate repeated
fetching/parsing of psql variables in psql's inner loops.  In a trivial
test with lots of 'select 1;' commands, psql's CPU time went down almost
10%, although of course the effect on total elapsed time was much less.
Per discussion about how to ensure the upcoming FETCH_COUNT patch doesn't
cost any performance when not being used.
12 files changed:
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/copy.c
src/bin/psql/describe.c
src/bin/psql/input.c
src/bin/psql/large_obj.c
src/bin/psql/mainloop.c
src/bin/psql/prompt.c
src/bin/psql/settings.h
src/bin/psql/startup.c
src/bin/psql/variables.c
src/bin/psql/variables.h