This is for explainPlan(). Somehow, we would want all join-compiler generated plans to avoid calling optimize again in explain. Thought of adding a flag into the BasicQueryPlan class or to the explainPlan() interface indicating where  optimize() should be called in explainPlan(), but was not sure if it's worth it.