File: test_index_concurrency

package info (click to toggle)
postgis 2.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 58,660 kB
  • ctags: 10,181
  • sloc: ansic: 132,858; sql: 131,148; xml: 46,460; sh: 4,832; perl: 4,476; makefile: 2,749; python: 1,198; yacc: 442; lex: 131
file content (42 lines) | stat: -rwxr-xr-x 924 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

if [ -z "$TMPDIR" ]; then
	TMPDIR=/tmp
fi

OUTFILE="${TMPDIR}/regress_index_out_$$"

echo "Running GiST concurrency Regression."

DB=postgis_reg
PGDATABASE=$DB
export PGDATABASE

if [ "$1" = "prepare" ]; then
	echo ""
	echo "Index Creation will take some time..."
	echo ""

	createdb > /dev/null
	createlang plpgsql > /dev/null
	psql -f ../lwpostgis.sql > /dev/null 2>&1

	psql -f regress_lots_of_points.sql 
	psql -c "CREATE INDEX quick_gist on test using gist (the_geom)" 
else
if [ "$1" = "run" ]; then
	# Concurrent clients:
	psql -c "update test set num=-num WHERE the_geom && 'BOX3D(125 125,135 135)'::box3d"  &
	psql -c "update test set num=-num WHERE the_geom && 'BOX3D(125 125,135 135)'::box3d"  &
	psql -c "update test set num=-num WHERE the_geom && 'BOX3D(125 125,135 135)'::box3d"  &
	 
	wait
else
if [ "$1" = "drop" ]; then
	dropdb $DB > /dev/null
else
	echo "Usage: $0 [prepare|run|drop]"
fi
fi
fi