Ticket #224 (new defect)

Opened 12 months ago

Last modified 9 months ago

Supply and optimise more OP_VALUE_ comparison operators

Reported by: richard Owned by: olly
Priority: low Milestone:
Component: Matcher Version: SVN trunk
Severity: minor Keywords:
Cc: Blocked By:
Operating System: All Blocking:

Description (last modified by olly) (diff)

We currently supply OP_VALUE_GE and OP_VALUE_LE. It might be useful to also supply OP_VALUE_GT and OP_VALUE_LT, and possibly OP_VALUE_EQ.

Also, we currently supply a range operator which can be represented in terms of two comparison operators: ie, OP_VALUE_RANGE(1, a, b) is equivalent to: (OP_VALUE_GE(1, a) AND OP_VALUE_LE(1, b)). It would be nice to teach the query optimiser about this equivalence, so that a range specified as two comparison operators would be transformed into an efficient single ValueRangePostList? internally, instead of the combination of two Value*Cmp*PostLists?. Also, the ValueRangePostList? could be made more flexible by adding flags to tell it whether each end of the range is inclusive or not, to allow other combinations of comparison operator to be represented as ranges.

Change History

Changed 12 months ago by richard

  • status changed from new to assigned

Changed 12 months ago by trac

  • platform set to All

Changed 12 months ago by olly

I think OP_VALUE_EQ would be ill-advised. If you want to find things matching an exact category, boolean terms are a lot more efficient, so OP_VALUE_EQ is just a tempting trap to disappoint users - for example:

http://article.gmane.org/gmane.comp.search.xapian.general/5481

If you really really know you want to do this (e.g. small collection, storing values for other reasons, smallest database size really matters) then you can just use OP_VALUE_RANGE with the same start and end.

Changed 9 months ago by olly

  • owner changed from newbugs to olly
  • status changed from assigned to new
  • description modified (diff)
Note: See TracTickets for help on using tickets.