[Xapian-tickets] [Xapian] #400: Optimise AND_MAYBE when the RHS has a maxweight of 0

Xapian nobody at xapian.org
Wed Dec 4 11:22:04 GMT 2019


#400: Optimise AND_MAYBE when the RHS has a maxweight of 0
-----------------------------+-------------------------------
 Reporter:  Richard Boulton  |             Owner:  Olly Betts
     Type:  enhancement      |            Status:  assigned
 Priority:  normal           |         Milestone:  1.5.0
Component:  Matcher          |           Version:  git master
 Severity:  minor            |        Resolution:
 Keywords:                   |        Blocked By:
 Blocking:                   |  Operating System:  All
-----------------------------+-------------------------------
Comment (by Olly Betts):

 I was thinking we set `factor = 0.0` for the subquery under `OP_SYNONYM`,
 because it's unweighted, but actually we don't - instead we save and
 restore the total_subqs value across turning it into a postlist, but keep
 factor non-zero (if factor is zero when we get to an `OP_SYNONYM` we turn
 it into an `OP_OR` anyway, since it's equivalent when the weight isn't
 used).

 That means the existing OP_AND_MAYBE `factor == 0.0` optimisation doesn't
 happen under `OP_SYNONYM` so we're good there.

 The new optimisation in the patch above ideally should not happen under
 `OP_SYNONYM` though.
-- 
Ticket URL: <https://trac.xapian.org/ticket/400#comment:6>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list