pgbench minor fixes

View: New views
6 Messages — Rating Filter:   Alert me  

pgbench minor fixes

by Simon Riggs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

[pgbench_minor.v1.patch]

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)



--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: pgbench minor fixes

by Russell Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Simon Riggs wrote:
> Minor patch on pgbench
>
> 1. -i option should run vacuum analyze only on pgbench tables, not *all*
> tables in database.
>  
How does this work with custom scripts?
> 2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY.
> This is just a slow version of TRUNCATE HISTORY.
>
>  


--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: pgbench minor fixes

by Greg Smith-12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 6 Jul 2008, Russell Smith wrote:

> Simon Riggs wrote:
>> Minor patch on pgbench
>>
>> 1. -i option should run vacuum analyze only on pgbench tables, not *all*
>> tables in database.
>>
> How does this work with custom scripts?

That's the initialization step.  It creates the 4 tables, populates then,
then runs VACCUM ANALYZE.  There is no notion of what script you'll end up
executing yet.  If you have a truly custom script that works against other
data instead of the pgbench tables, you won't even be executing this
initialization bit.

--
* Greg Smith gsmith@... http://www.gregsmith.com Baltimore, MD

--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: pgbench minor fixes

by Simon Riggs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, 2008-07-06 at 00:06 +1000, Russell Smith wrote:
> Simon Riggs wrote:
> > Minor patch on pgbench
> >
> > 1. -i option should run vacuum analyze only on pgbench tables, not *all*
> > tables in database.
> >  
> How does this work with custom scripts?

I don't think we can justify vacuuming every table in the database just
so we get any tables being used for one set of tests. Not in a utility
that many users have access to, not just superusers. If you use a custom
script you just need to write a pre-test script and run it with psql.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: pgbench minor fixes

by Tom Lane-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Simon Riggs <simon@...> writes:
> On Sun, 2008-07-06 at 00:06 +1000, Russell Smith wrote:
>> Simon Riggs wrote:
>>> 1. -i option should run vacuum analyze only on pgbench tables, not *all*
>>> tables in database.
>
>> How does this work with custom scripts?

> I don't think we can justify vacuuming every table in the database just
> so we get any tables being used for one set of tests.

Actually your point is that the -i option wouldn't be used anyway
with a custom script ...

                        regards, tom lane

--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Re: pgbench minor fixes

by Bruce Momjian-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Committed, commit fest page updated.

---------------------------------------------------------------------------

Simon Riggs wrote:

> 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

[ Attachment, skipping... ]

>
> --
> Sent via pgsql-patches mailing list (pgsql-patches@...)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-patches

--
  Bruce Momjian  <bruce@...>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-patches mailing list (pgsql-patches@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches