Skip to content

Commit 6152de9

Browse files
committed
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
1 parent 03302fd commit 6152de9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contrib/pgbench/pgbench.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* A simple benchmark program for PostgreSQL
55
* Originally written by Tatsuo Ishii and enhanced by many contributors.
66
*
7-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.80 2008/05/09 15:53:07 tgl Exp $
7+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.81 2008/08/22 17:57:34 momjian Exp $
88
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
99
* ALL RIGHTS RESERVED;
1010
*
@@ -1080,7 +1080,10 @@ init(void)
10801080

10811081
/* vacuum */
10821082
fprintf(stderr, "vacuum...");
1083-
executeStatement(con, "vacuum analyze");
1083+
executeStatement(con, "vacuum analyze branches");
1084+
executeStatement(con, "vacuum analyze tellers");
1085+
executeStatement(con, "vacuum analyze accounts");
1086+
executeStatement(con, "vacuum analyze history");
10841087

10851088
fprintf(stderr, "done.\n");
10861089
PQfinish(con);
@@ -1757,8 +1760,7 @@ main(int argc, char **argv)
17571760
fprintf(stderr, "starting vacuum...");
17581761
executeStatement(con, "vacuum branches");
17591762
executeStatement(con, "vacuum tellers");
1760-
executeStatement(con, "delete from history");
1761-
executeStatement(con, "vacuum history");
1763+
executeStatement(con, "truncate history");
17621764
fprintf(stderr, "end.\n");
17631765

17641766
if (do_vacuum_accounts)

src/backend/utils/adt/formatting.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.145 2008/07/12 00:44:37 tgl Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.146 2008/08/22 17:57:34 momjian Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -3197,9 +3197,7 @@ do_to_timestamp(text *date_txt, text *fmt,
31973197
* ISO week (Monday).
31983198
*/
31993199
if (tmfc.d)
3200-
{
32013200
isoweekdate2date(tmfc.iw, tmfc.d, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
3202-
}
32033201
else
32043202
isoweek2date(tmfc.iw, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
32053203
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy