diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-29 15:19:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-29 15:19:51 +0000 |
commit | 0434c46db059a80b0e89397a137dfa10421573f4 (patch) | |
tree | 43f7d6fd2e7a47c1d243ff1cb55f8df06a75b1ba /src/bin/psql/large_obj.c | |
parent | b681bfdd59918e3b65bd0b499075f99b39e511b5 (diff) |
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.
Diffstat (limited to 'src/bin/psql/large_obj.c')
-rw-r--r-- | src/bin/psql/large_obj.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bin/psql/large_obj.c b/src/bin/psql/large_obj.c index 778606c5f0e..48d8931e9fc 100644 --- a/src/bin/psql/large_obj.c +++ b/src/bin/psql/large_obj.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.45 2006/07/14 14:52:26 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/large_obj.c,v 1.46 2006/08/29 15:19:51 tgl Exp $ */ #include "postgres_fe.h" #include "large_obj.h" @@ -67,8 +67,7 @@ finish_lo_xact(const char *operation, bool own_transaction) { PGresult *res; - if (own_transaction && - GetVariableBool(pset.vars, "AUTOCOMMIT")) + if (own_transaction && pset.autocommit) { /* close out our own xact */ if (!(res = PSQLexec("COMMIT", false))) @@ -91,8 +90,7 @@ fail_lo_xact(const char *operation, bool own_transaction) { PGresult *res; - if (own_transaction && - GetVariableBool(pset.vars, "AUTOCOMMIT")) + if (own_transaction && pset.autocommit) { /* close out our own xact */ res = PSQLexec("ROLLBACK", false); |