SQL performance

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