Strabon
changeset 478:27a92cb6315c
execute VACUUM ANALYZE when insertMunicipalities takes a long time
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Fri Jul 20 14:35:34 2012 +0300 (2012-07-20) |
parents | 39688ed7f6d5 |
children | ccc5a44197a9 |
files | scripts/v2.2/runNoaRefinementChain.sh |
line diff
1.1 --- a/scripts/v2.2/runNoaRefinementChain.sh Fri Jul 20 14:19:39 2012 +0300 1.2 +++ b/scripts/v2.2/runNoaRefinementChain.sh Fri Jul 20 14:35:34 2012 +0300 1.3 @@ -86,8 +86,8 @@ 1.4 createdb ${DB} 1.5 1.6 # load data 1.7 -curl -s http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-Corine-dump-postgres-${POSTGRES_MAIN_VERSION}.tgz | tar xz -O | psql -d ${DB} 1.8 -psql ${DB} -c 'VACUUM ANALYZE ' 1.9 +curl -s http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-Corine-dump-postgres-${POSTGRES_MAIN_VERSION}.tgz | tar xz -O | psql -d ${DB} 1.10 +psql ${DB} -c 'VACUUM ANALYZE' 1.11 1.12 echo "starting tomcat" 1.13 if test -z "${tomcat}"; then 1.14 @@ -167,6 +167,13 @@ 1.15 tmr2=$(timer) 1.16 printf '%s ' $((tmr2-tmr1)) >>stderr.txt 1.17 echo;echo;echo;echo "File ${file} inserted Municipalities!" 1.18 + 1.19 + # execute an explicit VACUUM ANALYZE when a query takes longer than it should 1.20 + duration=$((tmr2-tmr1)) 1.21 + if test ${duration} -ge 30000; then 1.22 + psql ${DB} -c 'VACUUM ANALYZE' 1.23 + echo "Explicit VACUUM ANALYZE" 1.24 + fi 1.25 1.26 # deleteSeaHotspots 1.27 echo -n "Going to deleteSeaHotspots ${year}-${month}-${day}T${time2}:00 " ;echo; echo; echo;