#!/usr/bin/env bash

MACHINE=$1
LABEL=$2
DBNAME=$3

for r in $(seq 1 100); do

	for m in simple prepared; do

		for c in 1 4 8 16 32; do

			for l in 10000 1000000; do

				pgbench -M $m -c $c -j $c -T 10 -f select-$l.sql $DBNAME > pgbench.log 2>&1

				tps=$(grep tps pgbench.log | awk '{print $3}')

				echo $MACHINE $LABEL $r $m $c $l $tps

			done

		done

	done

done;
