Saturday, July 5, 2008

[PATCHES] pgbench minor fixes

Index: contrib/pgbench/pgbench.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/contrib/pgbench/pgbench.c,v
retrieving revision 1.80
diff -c -r1.80 pgbench.c
*** contrib/pgbench/pgbench.c 9 May 2008 15:53:07 -0000 1.80
--- contrib/pgbench/pgbench.c 5 Jul 2008 12:58:09 -0000
***************
*** 1080,1086 ****

/* vacuum */
fprintf(stderr, "vacuum...");
! executeStatement(con, "vacuum analyze");

fprintf(stderr, "done.\n");
PQfinish(con);
--- 1080,1089 ----

/* vacuum */
fprintf(stderr, "vacuum...");
! 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,1764 ****
fprintf(stderr, "starting vacuum...");
executeStatement(con, "vacuum branches");
executeStatement(con, "vacuum tellers");
! executeStatement(con, "delete from history");
! executeStatement(con, "vacuum history");
fprintf(stderr, "end.\n");

if (do_vacuum_accounts)
--- 1760,1766 ----
fprintf(stderr, "starting vacuum...");
executeStatement(con, "vacuum branches");
executeStatement(con, "vacuum tellers");
! executeStatement(con, "truncate history");
fprintf(stderr, "end.\n");

if (do_vacuum_accounts)
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

www.2ndQuadrant.com

PostgreSQL Training, Services and Support

No comments: