--- /dev/null
+#!/bin/bash
+#
+# DO NOT EDIT - This file is being maintained by Chef
+
+
+# Vaccum all tables with indices on integer arrays.
+# Agressive vacuuming seems to help against index bloat.
+psql -q -d nominatim -c 'VACUUM ANALYSE search_name'
+psql -q -d nominatim -c 'VACUUM ANALYSE search_name_country'
+
+for i in `seq 0 246`; do
+ psql -q -d nominatim -c "VACUUM ANALYSE search_name_${i}"
+done
+
+<% if node[:postgres][:settings][:archive_mode] == "on" -%>
+
+# Cleanup archive directory
+find -L /data/postgresql-archive -mtime +3 -print0 | xargs -0r rm
+
+<% end -%>