corrected syntax errors and added cluster, vacuum and analyze to improve performance