[Xapian-tickets] [Xapian] #304: Calculate LHS weight earlier in AND_MAYBE to avoid calling RHS in some cases

Xapian nobody at xapian.org
Wed Oct 15 10:14:00 BST 2008


#304: Calculate LHS weight earlier in AND_MAYBE to avoid calling RHS in some
cases
-------------------------+--------------------------------------------------
 Reporter:  richard      |       Owner:  olly    
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:          
Component:  Matcher      |     Version:  SVN HEAD
 Severity:  normal       |   Blockedby:          
 Platform:  All          |    Blocking:          
-------------------------+--------------------------------------------------
 Currently, the next() operation for AND_MAYBE is implemented such that the
 LHS is advanced to its next position, and then the RHS is skipped forward
 to that position.  Each of these moves is supplied with a minweight of the
 difference between the minweight supplied to the AndMaybePostList::next()
 call and the maxweight of the other side.

 However, once the LHS has settled on a position, we could instead ask the
 LHS for its weight, and pass a tighter minweight value to the RHS based on
 the actual weight of the LHS, rather than its maxweight.  This tighter
 bound would only be valid for the actual document being supplied to the
 skip_to(), so we'd need to use a new method on postlists to support this.

 The same kind of optimisation might be applicable in other situations; the
 problem is that we need to know when its worth calculating the weight for
 the postlist we've just moved (which may involve a disk access to get the
 document length, for example), rather than trying to move the RHS.

-- 
Ticket URL: <http://trac.xapian.org/ticket/304>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list