You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by io...@group.novartis.com on 2004/07/09 11:52:44 UTC

why same query different execution time?

Can somebody explain me following:

I execute search with  the same query, on the same index using the same pc 
an get always different execution time, for example:

1st run:
LuceneItems: Search for : +contents:vasella, Documents found : 121, 
Documents age : [15.09.04 -10.08.02]
LuceneItems: Last document retrieved - 39, Search time(ms) - 1362
2d run:
LuceneItems: Search for : +contents:vasella, Documents found : 121, 
Documents age : [15.09.04 -10.08.02]
LuceneItems: Last document retrieved - 39, Search time(ms) - 584

Regards
Joel

Re: why same query different execution time?

Posted by Morus Walter <mo...@tanto.de>.
Hi,

> I execute search with  the same query, on the same index using the same pc 
> an get always different execution time, for example:
> 
> 1st run:
> LuceneItems: Search for : +contents:vasella, Documents found : 121, 
> Documents age : [15.09.04 -10.08.02]
> LuceneItems: Last document retrieved - 39, Search time(ms) - 1362
> 2d run:
> LuceneItems: Search for : +contents:vasella, Documents found : 121, 
> Documents age : [15.09.04 -10.08.02]
> LuceneItems: Last document retrieved - 39, Search time(ms) - 584
> 
The first search reads the index from disk to memory. The second profits
of caching (by the operating system, not by lucene) and thus is faster.
To get the same time you need to make sure that the conditions are equal.
E.g. boot before each test... And it will still slightly differ due to
background processes.

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org