lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Penning <>
Subject Re[2]: improve performance of "AND-queries"
Date Thu, 23 Oct 2003 10:15:48 GMT
Hallo Erik,

EH> Do you have some performance numbers to go with this?

+_key:23/*              -> 801 hits  80-90 ms
+24:8397                -> 10 hits   <10 ms
+24:8397 +_key:23/*     -> 5 hits    80-90 ms

Info: The index size is 118kb.

If Lucene first searches for +24:8397 and then checks if the rest of
the queries matches those documents found, it might be able to return
the result much faster.

The execution time when using a QueryFilter is nearly the same (~10ms

EH> One thing I'd love to see is some JUnitPerf tests added to Lucene's 
EH> test suite - maybe you could come up with a test case that shows the 
EH> performance issue explicitly here?

EH> Also, if you are doing this type of query repeatedly, look into using a 
EH> QueryFilter that uses the most restrictive query as the filter, which 
EH> will limit the search space of the second query.

EH>         Erik

EH> On Thursday, October 23, 2003, at 04:43  AM, Daniel Penning wrote:

>> Hi
>> The performance of queries using AND (and +) could be greatly improved.
>> Example:
>> title:"The Right Way"                 -> 10 hits
>> text:go                               -> 100 hits
>> title:"The Right Way" AND text:go     -> 5 hits
>> It looks like both parts of the query are executed seperatly and then
>> they are merged. If Lucene would be able to execute the query with
>> less results (text:go) first and then only check if the second part
>> (title:"The Right Way") matches, those queries would be much faster.
>> Daniel Penning
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

EH> ---------------------------------------------------------------------
EH> To unsubscribe, e-mail:
EH> For additional commands, e-mail:

Daniel Penning

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message