]> git.openstreetmap.org Git - nominatim.git/commitdiff
cron job for vacuuming intarray indices
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 15 Apr 2012 13:57:50 +0000 (15:57 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 15 Apr 2012 13:57:50 +0000 (15:57 +0200)
utils/cron_vacuum.sh [new file with mode: 0755]

diff --git a/utils/cron_vacuum.sh b/utils/cron_vacuum.sh
new file mode 100755 (executable)
index 0000000..f33e8bb
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# Vaccum all tables with indices on integer arrays.
+# Agressive vacuuming seems to help against index bloat.
+#
+
+psql -d nominatim -c 'VACUUM ANALYSE search_name' >/dev/null
+psql -d nominatim -c 'VACUUM ANALYSE search_name_country' >/dev/null
+psql -d nominatim -c 'VACUUM ANALYSE planet_osm_ways' >/dev/null
+
+for i in `seq 0 246`; do
+  psql -d nominatim -c "VACUUM ANALYSE search_name_${i}" >/dev/null
+done
+