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
|
|
@ -105,6 +105,14 @@ func (it *HasA) Optimize() (graph.Iterator, bool) {
|
|||
return it.primaryIt, true
|
||||
}
|
||||
}
|
||||
// Ask the graph.QuadStore if we can be replaced. Often times, this is a great
|
||||
// optimization opportunity (there's a fixed iterator underneath us, for
|
||||
// example).
|
||||
newReplacement, hasOne := it.qs.OptimizeIterator(it)
|
||||
if hasOne {
|
||||
it.Close()
|
||||
return newReplacement, true
|
||||
}
|
||||
return it, false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue