optimizer: address comment.

This commit is contained in:
qiuyesuifeng
2016-01-12 12:42:11 +08:00
parent e904cd90d7
commit eb5dbcfcd5

View File

@ -39,18 +39,16 @@ func Optimize(ctx context.Context, node ast.Node) (plan.Plan, error) {
if err != nil {
return nil, errors.Trace(err)
}
err = plan.Refine(p)
if err != nil {
return nil, errors.Trace(err)
}
bestPlan := p
bestCost := plan.EstimateCost(p)
alts, err := plan.Alternatives(p)
if err != nil {
return nil, errors.Trace(err)
}
err = plan.Refine(p)
if err != nil {
return nil, errors.Trace(err)
}
bestCost := plan.EstimateCost(p)
bestPlan := p
for _, alt := range alts {
err = plan.Refine(alt)
if err != nil {