1. A method for query optimization in a scale-out system with a single query processing machine and a distributed storage engine to store data, comprising: receiving a query rewritten for an internal schema; optimizing a query execution plan for the query; and executing the plan and returning result to an application.