fix overshoot and optimize better

This commit is contained in:
Barak Michener 2014-08-06 03:20:33 -04:00
parent 09244ddd38
commit 24f57df859
4 changed files with 21 additions and 10 deletions

View file

@ -300,7 +300,7 @@ func materializeIts(its []graph.Iterator) []graph.Iterator {
for _, it := range its {
stats := it.Stats()
if stats.Size*stats.NextCost < stats.ContainsCost {
if graph.Height(it) > 10 {
if graph.Height(it, graph.Materialize) > 10 {
out = append(out, NewMaterialize(it))
continue
}