Option to remove size calls
Fix permutations of optimization intersections Return empty string as per bolt fix case sensitivity and memstore panic
This commit is contained in:
parent
aedd0401e2
commit
fab8cd64b3
4 changed files with 34 additions and 3 deletions
|
|
@ -28,10 +28,16 @@ func intersect(a sqlIterator, b sqlIterator, qs *QuadStore) (*SQLIterator, error
|
|||
if bnew, ok := b.(*SQLNodeIterator); ok {
|
||||
return intersectNode(anew, bnew, qs)
|
||||
}
|
||||
if bnew, ok := b.(*SQLNodeIntersection); ok {
|
||||
return appendNodeIntersection(bnew, anew, qs)
|
||||
}
|
||||
} else if anew, ok := a.(*SQLNodeIntersection); ok {
|
||||
if bnew, ok := b.(*SQLNodeIterator); ok {
|
||||
return appendNodeIntersection(anew, bnew, qs)
|
||||
}
|
||||
if bnew, ok := b.(*SQLNodeIntersection); ok {
|
||||
return combineNodeIntersection(anew, bnew, qs)
|
||||
}
|
||||
} else if anew, ok := a.(*SQLLinkIterator); ok {
|
||||
if bnew, ok := b.(*SQLLinkIterator); ok {
|
||||
return intersectLink(anew, bnew, qs)
|
||||
|
|
@ -65,6 +71,17 @@ func appendNodeIntersection(a *SQLNodeIntersection, b *SQLNodeIterator, qs *Quad
|
|||
return it, nil
|
||||
}
|
||||
|
||||
func combineNodeIntersection(a *SQLNodeIntersection, b *SQLNodeIntersection, qs *QuadStore) (*SQLIterator, error) {
|
||||
m := &SQLNodeIntersection{
|
||||
tableName: newTableName(),
|
||||
nodeIts: append(a.nodeIts, b.nodeIts...),
|
||||
}
|
||||
m.Tagger().CopyFromTagger(a.Tagger())
|
||||
m.Tagger().CopyFromTagger(b.Tagger())
|
||||
it := NewSQLIterator(qs, m)
|
||||
return it, nil
|
||||
}
|
||||
|
||||
func intersectLink(a *SQLLinkIterator, b *SQLLinkIterator, qs *QuadStore) (*SQLIterator, error) {
|
||||
m := &SQLLinkIterator{
|
||||
tableName: newTableName(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue