#!/bin/bash

sumcol=c10
seconds=3
database=postgres

declare -a tables=("normal" "missing" "dropped")

psql -f create_tables.sql $database

for table in "${tables[@]}"
do
	echo "select sum($sumcol) from $table;" > benchmark_file.sql
	echo "*** Benchmarking $table table..."
	echo
	pgbench -n -T $seconds -f benchmark_file.sql $database
done
