lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <>
Subject Re: improve performance of "AND-queries"
Date Thu, 23 Oct 2003 17:42:27 GMT
I am not familiar enough with the query parser syntax, but is the * a 
wildcard? If so, that's what is causing the extra delay. If you want to 
speed this type of query up, the QueryFilter should be probably created 
on the wildcard query, not on the most restrictive one.

Lucene's internals are somewhat different than a typical database 
system. For instance, to execute a wildcard query, it needs to retrieve 
all tokens found in this field in all documents that match the wildcard. 
Then it turns this into an "OR" query and goes from there. Things get a 
bit better with a "starts with" type of wildcard, but it still ends up 
with some prep work and an OR-type query, I believe.


Erik Hatcher wrote:

> On Thursday, October 23, 2003, at 06:15  AM, Daniel Penning wrote:
>> 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.
> Thanks for the numbers.
>> The execution time when using a QueryFilter is nearly the same (~10ms
>> faster).
> Keep in mind that QueryFilter will only be faster on successive uses 
> of it (the same instance, that is) as it caches the bitset of matching 
> documents, so successive calls only search the matched ones from the 
> first time around.
>     Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message