updating sql
caching stuff