Optimize the sql statements.