pgbench minor fixes

Simon Riggs <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.patches
Message-ID <[email protected]>
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


-- 
Sent via pgsql-patches mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
pgbench_minor.v1.patch (text/x-patch, 1.4 KB)
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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.