Optimize by collapsing trees into single SQL queries
This commit is contained in:
parent
185e236f15
commit
621acae945
7 changed files with 501 additions and 50 deletions
|
|
@ -103,6 +103,7 @@ func (it *And) Optimize() (graph.Iterator, bool) {
|
|||
newReplacement, hasOne := it.qs.OptimizeIterator(newAnd)
|
||||
if hasOne {
|
||||
newAnd.Close()
|
||||
glog.V(3).Infoln(it.UID(), "became", newReplacement.UID(), "from quadstore")
|
||||
return newReplacement, true
|
||||
}
|
||||
}
|
||||
|
|
@ -330,7 +331,7 @@ func materializeIts(its []graph.Iterator) []graph.Iterator {
|
|||
out = append(out, its[0])
|
||||
for _, it := range its[1:] {
|
||||
stats := it.Stats()
|
||||
if stats.Size*stats.NextCost < (stats.ContainsCost * (1 + (stats.Size / (allStats.Size + 1)))) {
|
||||
if false && stats.Size*stats.NextCost < (stats.ContainsCost*(1+(stats.Size/(allStats.Size+1)))) {
|
||||
if graph.Height(it, graph.Materialize) > 10 {
|
||||
out = append(out, NewMaterialize(it))
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue