Update sql script.
Optimization.