[Xapian-tickets] [Xapian] #304: Calculate LHS weight earlier in AND_MAYBE to avoid calling RHS in some cases
Xapian
nobody at xapian.org
Sun Oct 15 01:12:31 BST 2017
#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 trunk
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-------------------------+------------------------------
Comment (by olly):
In [b290278a85e7d4c953450a499cdf7e64f6172574] I reimplemented
`AndMaybePostList`. In the new implementation, `next()` calls `check()`
on the RHS instead of `skip_to()`, so for a phrase RHS we now only check
if the RHS matches the current docid from the LHS - we won't keep
advancing the RHS if it doesn't match there.
That doesn't render this ticket obsolete though - a tighter bound for the
RHS which is only correct for current document is potentially useful for
allowing the RHS to give a short-cut "no" early, such as in this
situation:
> Also, if the RHS was a phrase operator, it is possible to determine the
weight of the phrase before checking if the phrase actually existed - this
could avoid needing to access the positional information in some cases.
There are other cases too - an OR subquery on the RHS could determine that
it can't match with enough weight for a given document after seeing that a
subset of its subqueries don't match it.
And indeed this probably would make more sense as a variant on `check()`
rather than `skip_to()` (or perhaps an extra parameter on `check()`.
--
Ticket URL: <https://trac.xapian.org/ticket/304#comment:3>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list