test_many_tables

text/plain

Filename: test_many_tables
Type: text/plain
Part: 0
Message: Re: Further pg_upgrade analysis for many tables
:

. traprm

export QUIET=$((QUIET + 1))

> /rtmp/out

for CYCLES in 1 1000 2000 4000 8000 16000
do
	echo "$CYCLES" >> /rtmp/out

	for DIR in /pgtoprel /pgtop
	do	echo "$DIR" >> /rtmp/out
		cd "$DIR"
		pginstall

		# need for +16k
		pipe sed 's/#max_locks_per_transaction = 64/max_locks_per_transaction = 500/' /u/pg/data/postgresql.conf
		pipe sed 's/shared_buffers = 128MB/shared_buffers = 1GB/' /u/pg/data/postgresql.conf
		pipe sed 's/#work_mem = 1MB/work_mem = 500MB/' /u/pg/data/postgresql.conf
		pipe sed 's/#maintenance_work_mem = 16MB/maintenance_work_mem = 500MB/' /u/pg/data/postgresql.conf
		pgrestart
		sleep 2

		for JOT in $(jot "$CYCLES"); do echo "CREATE TABLE test$JOT (x SERIAL);"; done| PGOPTIONS="-c synchronous_commit=off" sql test
		echo "pg_dump creation" >> /rtmp/out
		/usr/bin/time --output=/rtmp/out --append --format '%e' aspg pg_dump --schema-only test > $TMP/1
		newdb test
		echo "pg_dump restore" >> /rtmp/out
		PGOPTIONS="-c synchronous_commit=off" /usr/bin/time --output=/rtmp/out --append --format '%e' sql test < $TMP/1
		pgstop
		sleep 2
	done
done

bell