Optimizing Query Processing For Data-Intensive Computation