When we build the `Execute` plan, the underlying plan is not built, so we don't know what the plan is before we execute it. This PR move the plan building for prepared statement to optimizer, so we know what plan we are going to execute before we execute it.