# Makefile--
# 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
-# $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 $
#
#-------------------------------------------------------------------------
CREATEFILES= create.sql bench.sql
OUTFILES= bench.out bench.out.perquery
-override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
-override CFLAGS += $(CFLAGS_SL)
-
all: $(CREATEFILES)
rm -f $(OUTFILES)
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 $@; \
C=`pwd`; \
- sed -e "s:_CWD_:$$C:g" \
- -e "s:_OBJWD_:$$C:g" \
- -e "s:_SLSUFF_:$(SLSUFF):g" \
- -e "s/_USER_/$$USER/g" < $< > $@
+ sed -e "s:_CWD_:$$C:g" < $< > $@
bench.sql:
x=1; \
bench.out: $(CREATEFILES)
$(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";
bench.out.perquery: bench.out
- $(SHELL) ./perquery <bench.out 2>&1 > $@
- @echo "BREAKDOWN OF BENCHMARK IS SAVED IN FILE" \
- "bench.out.perquery";
+ $(SHELL) ./perquery <bench.out > $@
+ @echo "BREAKDOWN OF BENCHMARK IS SAVED IN FILE bench.out.perquery";
clean:
rm -f $(OUTFILES) $(CREATEFILES)
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
Postgres version of the Wisconsin benchmark. In order to run the benchmark,
you'll initially need to execute the script
#!/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
- echo " you must specify a valid data directory "
+ echo " you must specify a valid data directory " >&2
exit
fi
if [ -d ./obj ]; then
exit 1
fi
-postgres -D${1} -Q bench < create.sql > /dev/null
+postgres -D${1} bench < create.sql > /dev/null
if [ $? -ne 0 ]; then
echo initial database load failed
exit 1
#!/bin/sh
-egrep 'x = "|elapse' > /tmp/foo$$
-
+egrep 'x = "|elapse' | \
awk 'BEGIN { x = 0; y = 0; z = 0; a = 0; } \
/.*elapse.*/ {x = $2 + x; y = $4 + y; z = $6 + z;} \
/.*x = ".*/ { \
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; } \
- END {printf("query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z);}' \
- < /tmp/foo$$
-
+ END {printf("query %2d: %7.3f real %7.3f user %7.3f sys\n", a, x, y, z);}'
#!/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
# following fashion:
# time $POSTGRES -texecutor -tplanner -f hashjoin -Q bench
#
if [ ! -d $1 ]; then
- echo " you must specify a valid data directory "
+ echo " you must specify a valid data directory " >&2
exit
fi
cd ./obj
fi
-echo =============== vacuuming benchmark database... =================
-echo "vacuum" | postgres -D${1} -Q bench > /dev/null
+echo =============== vacuuming benchmark database... ================= >&2
+echo "vacuum" | postgres -D${1} bench > /dev/null
-echo =============== running benchmark... =================
-time postgres -D${1} -texecutor -tplanner -Q bench < bench.sql
+echo =============== running benchmark... ================= >&2
+time postgres -D${1} -texecutor -tplanner -c log_min_messages=log -c log_destination=stderr -c redirect_stderr=off bench < bench.sql 2>&1