aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2008-08-22 17:57:34 +0000
committerBruce Momjian <bruce@momjian.us>2008-08-22 17:57:34 +0000
commit6152de97d3c3969cce482446507651fbfd513b1c (patch)
tree3819070b234d13fa63d53d2d6008f419fc24cf36
parent03302fd9b477334487bc50c1e1f904b06f857082 (diff)
downloadpostgresql-6152de97d3c3969cce482446507651fbfd513b1c.tar.gz
postgresql-6152de97d3c3969cce482446507651fbfd513b1c.zip
Minor patch on pgbench
1. -i option should run vacuum analyze only on pgbench tables, not *all* tables in database. 2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY. This is just a slow version of TRUNCATE HISTORY. Simon Riggs
-rw-r--r--contrib/pgbench/pgbench.c10
-rw-r--r--src/backend/utils/adt/formatting.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index cfa6c5fb89b..bbe97b929fe 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -4,7 +4,7 @@
* A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors.
*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.80 2008/05/09 15:53:07 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.81 2008/08/22 17:57:34 momjian Exp $
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@@ -1080,7 +1080,10 @@ init(void)
/* vacuum */
fprintf(stderr, "vacuum...");
- executeStatement(con, "vacuum analyze");
+ executeStatement(con, "vacuum analyze branches");
+ executeStatement(con, "vacuum analyze tellers");
+ executeStatement(con, "vacuum analyze accounts");
+ executeStatement(con, "vacuum analyze history");
fprintf(stderr, "done.\n");
PQfinish(con);
@@ -1757,8 +1760,7 @@ main(int argc, char **argv)
fprintf(stderr, "starting vacuum...");
executeStatement(con, "vacuum branches");
executeStatement(con, "vacuum tellers");
- executeStatement(con, "delete from history");
- executeStatement(con, "vacuum history");
+ executeStatement(con, "truncate history");
fprintf(stderr, "end.\n");
if (do_vacuum_accounts)
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 0ab84200e5e..3882f84c84a 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.145 2008/07/12 00:44:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.146 2008/08/22 17:57:34 momjian Exp $
*
*
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -3197,9 +3197,7 @@ do_to_timestamp(text *date_txt, text *fmt,
* ISO week (Monday).
*/
if (tmfc.d)
- {
isoweekdate2date(tmfc.iw, tmfc.d, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
- }
else
isoweek2date(tmfc.iw, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
}