#!/bin/bash dbname=postgres # Must match what was used in the test setup script extra_cols_start=0 extra_cols_end=40 extra_cols_increment=10 # How many times to run each test. 10 - 100 is probably good number_of_runs=10 me=$(basename "$0") if [ $# -lt 3 ] then echo "Syntax: ./$me " exit 1 fi machine=$1 compiler=$2 branch=$3 psql -c "truncate table deform_results;" $dbname echo "Results will be stored in the deform_results table" echo -n "Running tests..." for test_id in {1..8} do for c in $(seq $extra_cols_start $extra_cols_increment $extra_cols_end) do let "deform_attnum=c+3" tablename="t_${test_id}_${c}" echo -ne "\rRunning test $test_id of 8 with $c extra columns..." psql -c "select pg_prewarm('$tablename'); insert into deform_results (machine, cc, branch, test_id, extra_columns, run_id, milliseconds) select '${machine}','${compiler}','${branch}',${test_id},${c},run_id,deform_bench('$tablename'::regclass, '{$deform_attnum}') from generate_series(1,$number_of_runs) run_id;" $dbname > /dev/null done done echo "" echo "" echo "The results are:" psql --csv -c "select branch,test_id,extra_columns,round(avg(milliseconds)::numeric,2) avg_ms,stddev(milliseconds) AS stddev from deform_results where machine = '$machine' and cc='$compiler' and branch='$branch' group by 1,2,3 order by 3,1,2;" $dbname