Optimization of SQL Queries for Parallel Machines