]> granicus.if.org Git - postgis/commitdiff
Added index concurrency tester
authorSandro Santilli <strk@keybit.net>
Tue, 28 Jun 2005 22:01:02 +0000 (22:01 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 28 Jun 2005 22:01:02 +0000 (22:01 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/pgis_1_0@1792 b70326c6-7e19-0410-871a-916f4a2858ee

regress/test_index_concurrency [new file with mode: 0755]

diff --git a/regress/test_index_concurrency b/regress/test_index_concurrency
new file mode 100755 (executable)
index 0000000..612ed63
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+if [ -z "$TMPDIR" ]; then
+       TMPDIR=/tmp
+fi
+
+OUTFILE="${TMPDIR}/regress_index_out_$$"
+
+echo "Running GiST concurrency Regression."
+
+DB=postgis_reg
+export PGDATABASE=$DB
+
+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
+