lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadav Har'El" <...@math.technion.ac.il>
Subject Re: IndexReader.isCurrent in presence of many files
Date Sun, 13 May 2007 10:24:14 GMT
On Fri, May 11, 2007, Yonik Seeley wrote about "Re: IndexReader.isCurrent in presence of many
files":
> On 5/11/07, Doron Cohen <DORONC@il.ibm.com> wrote:
> >However, isCurrent() may be called before every query.
> 
> That's never going to be a high performance architecture.

Why is that so?
Potentially, isCurrent() could do a couple of disk accesses (and usually
cached by the operating system), which is much faster than running the
actual query, which needs to read a lot more from disk (of course, that
is often cached as well) and do a lot more processing.

If isCurrent() takes 50ms (and I'm just inventing a number here), one way
to look at it is to say that it limits the number of calls to 20 each
second, which rules out high performance. The other way to look at is to
say that each query takes 200ms (say), so that the added 50ms is more-or-less
negligable.

Of course, the application could, and probably should, have its own mechanism
for specifying when the index needs to be reopened after a background process
modified it. But very often, just using isCurrent() is very convenient, and
works well.

So if isCurrent() can be kept reasonably quick (at least on local disks),
it would be great.

-- 
Nadav Har'El                        |       Sunday, May 13 2007, 25 Iyyar 5767
IBM Haifa Research Lab              |-----------------------------------------
                                    |How do you get holy water? Boil the hell
http://nadav.harel.org.il           |out of it.

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


Mime
View raw message