Commit 272cc8e2 authored by Tom Lane's avatar Tom Lane

Whack Wisconsin benchmark around until it actually works again.

It's still useless because it tests a standalone backend, but at least
the bit rot is repaired.
parent d1b2260c
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
# Makefile-- # Makefile--
# Makefile for the Wisconsin Benchmark # Makefile for the Wisconsin Benchmark
# #
# Copyright (c) 1994-5, Regents of the University of California # Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
# Portions Copyright (c) 1994-5, Regents of the University of California
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.10 2003/11/29 19:52:14 pgsql Exp $ # $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.11 2004/09/01 17:25:40 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -18,23 +19,14 @@ include $(top_builddir)/src/Makefile.global ...@@ -18,23 +19,14 @@ include $(top_builddir)/src/Makefile.global
CREATEFILES= create.sql bench.sql CREATEFILES= create.sql bench.sql
OUTFILES= bench.out bench.out.perquery OUTFILES= bench.out bench.out.perquery
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(CFLAGS_SL)
all: $(CREATEFILES) all: $(CREATEFILES)
rm -f $(OUTFILES) rm -f $(OUTFILES)
create.sql: create.source create.sql: create.source
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
rm -f $@; \ rm -f $@; \
C=`pwd`; \ C=`pwd`; \
sed -e "s:_CWD_:$$C:g" \ sed -e "s:_CWD_:$$C:g" < $< > $@
-e "s:_OBJWD_:$$C:g" \
-e "s:_SLSUFF_:$(SLSUFF):g" \
-e "s/_USER_/$$USER/g" < $< > $@
bench.sql: bench.sql:
x=1; \ x=1; \
...@@ -48,13 +40,12 @@ runtest: $(OUTFILES) ...@@ -48,13 +40,12 @@ runtest: $(OUTFILES)
bench.out: $(CREATEFILES) bench.out: $(CREATEFILES)
$(SHELL) ./create.sh $$PGDATA && \ $(SHELL) ./create.sh $$PGDATA && \
$(SHELL) ./runwisc.sh $$PGDATA >bench.out 2>&1 $(SHELL) ./runwisc.sh $$PGDATA > $@
@echo "RESULTS OF BENCHMARK ARE SAVED IN FILE bench.out"; @echo "RESULTS OF BENCHMARK ARE SAVED IN FILE bench.out";
bench.out.perquery: bench.out bench.out.perquery: bench.out
$(SHELL) ./perquery <bench.out 2>&1 > $@ $(SHELL) ./perquery <bench.out > $@
@echo "BREAKDOWN OF BENCHMARK IS SAVED IN FILE" \ @echo "BREAKDOWN OF BENCHMARK IS SAVED IN FILE bench.out.perquery";
"bench.out.perquery";
clean: clean:
rm -f $(OUTFILES) $(CREATEFILES) rm -f $(OUTFILES) $(CREATEFILES)
The Postgres Wisconsin Benchmark The Postgres Wisconsin Benchmark
The short form of the directions below:
ensure postmaster is stopped
export PGDATA=/wherever
make runtest
The long form:
In this directory are the queries and raw data files used to populate the In this directory are the queries and raw data files used to populate the
Postgres version of the Wisconsin benchmark. In order to run the benchmark, Postgres version of the Wisconsin benchmark. In order to run the benchmark,
you'll initially need to execute the script you'll initially need to execute the script
......
#!/bin/sh #!/bin/sh
# $PostgreSQL: pgsql/src/test/bench/create.sh,v 1.3 2003/11/29 19:52:14 pgsql Exp $ # $PostgreSQL: pgsql/src/test/bench/create.sh,v 1.4 2004/09/01 17:25:40 tgl Exp $
# #
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
echo " you must specify a valid data directory " echo " you must specify a valid data directory " >&2
exit exit
fi fi
if [ -d ./obj ]; then if [ -d ./obj ]; then
...@@ -19,7 +19,7 @@ if [ $? -ne 0 ]; then ...@@ -19,7 +19,7 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
postgres -D${1} -Q bench < create.sql > /dev/null postgres -D${1} bench < create.sql > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo initial database load failed echo initial database load failed
exit 1 exit 1
......
#!/bin/sh #!/bin/sh
egrep 'x = "|elapse' > /tmp/foo$$ egrep 'x = "|elapse' | \
awk 'BEGIN { x = 0; y = 0; z = 0; a = 0; } \ awk 'BEGIN { x = 0; y = 0; z = 0; a = 0; } \
/.*elapse.*/ {x = $2 + x; y = $4 + y; z = $6 + z;} \ /.*elapse.*/ {x = $2 + x; y = $4 + y; z = $6 + z;} \
/.*x = ".*/ { \ /.*x = ".*/ { \
printf "query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z; \ printf "query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z; \
x = 0; y = 0; z = 0; a = a + 1; } \ x = 0; y = 0; z = 0; a = a + 1; } \
END {printf("query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z);}' \ END {printf("query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z);}'
< /tmp/foo$$
#!/bin/sh #!/bin/sh
# $PostgreSQL: pgsql/src/test/bench/runwisc.sh,v 1.5 2003/11/29 19:52:14 pgsql Exp $ # $PostgreSQL: pgsql/src/test/bench/runwisc.sh,v 1.6 2004/09/01 17:25:40 tgl Exp $
# #
# Note that in our published benchmark numbers, we executed the command in the # Note that in our published benchmark numbers, we executed the command in the
# following fashion: # following fashion:
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# time $POSTGRES -texecutor -tplanner -f hashjoin -Q bench # time $POSTGRES -texecutor -tplanner -f hashjoin -Q bench
# #
if [ ! -d $1 ]; then if [ ! -d $1 ]; then
echo " you must specify a valid data directory " echo " you must specify a valid data directory " >&2
exit exit
fi fi
...@@ -15,8 +15,8 @@ if [ -d ./obj ]; then ...@@ -15,8 +15,8 @@ if [ -d ./obj ]; then
cd ./obj cd ./obj
fi fi
echo =============== vacuuming benchmark database... ================= echo =============== vacuuming benchmark database... ================= >&2
echo "vacuum" | postgres -D${1} -Q bench > /dev/null echo "vacuum" | postgres -D${1} bench > /dev/null
echo =============== running benchmark... ================= echo =============== running benchmark... ================= >&2
time postgres -D${1} -texecutor -tplanner -Q bench < bench.sql time postgres -D${1} -texecutor -tplanner -c log_min_messages=log -c log_destination=stderr -c redirect_stderr=off bench < bench.sql 2>&1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment