Skip to content

Commit

Permalink
Add temporal statement_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Aug 2, 2024
1 parent 7af84e6 commit 1729a54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion images/tiler-server/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ while "$flag" = true; do
pg_isready -h $POSTGRES_HOST -U $POSTGRES_USER -p $POSTGRES_PORT >/dev/null 2>&1 || continue
flag=false
echo "Running ANALYZE for tables"
time psql -U $POSTGRES_USER -h $POSTGRES_HOST -d $POSTGRES_DB -c "DO \$\$ DECLARE r RECORD; BEGIN FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP EXECUTE 'ANALYZE ' || r.tablename; END LOOP; END \$\$;"

# Set temporary statement_timeout
time psql -U $POSTGRES_USER -h $POSTGRES_HOST -d $POSTGRES_DB -c "SET statement_timeout = '300000'; DO \$\$ DECLARE r RECORD; BEGIN FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP EXECUTE 'ANALYZE ' || r.tablename; END LOOP; END \$\$;"

export TEGOLA_SQL_DEBUG=LAYER_SQL:EXECUTE_SQL
tegola serve --config=/opt/tegola_config/config.toml
done

0 comments on commit 1729a54

Please sign in to comment.