== Phase P3: QueryOptimization