SQL performance

Execution time can be greatly improved, when using SQL instructions in the right way.