#!/bin/sh

# Run on standby before updater is started

DB="pgbench"
SCALE=`psql -d $DB -At -c "select count(*) from pgbench_branches"`
CLIENTS=4
TIME=60

echo Priming the cache to remove disk impact and confirm data exists
SUM=`psql -d $DB -At -c "select sum(abalance) from pgbench_accounts"`
echo Expected account sum is $SUM

while [ 1 ]; do 
  date
  echo Running pgbench for $TIME seconds
  pgbench -c $CLIENTS -s $SCALE -T $TIME -n -f account-scan.sql $DB
done

