Queries cannot be ordered "sequentially". Let's say that you run 3 Queries,
w/ one term each "a", "b" and "c". On disk, the posting lists of the terms
can look like this: post1(a), post1(c), post2(a), post1(b), post2(c),
post2(b) etc. They are not guaranteed to be consecutive. The code makes sure
the posting list parts come logically one after the others, by
file-system-wise, they can be completely messed up on disk.

Besides, I'm not sure that what you want will get you anything. If you run 3
queries in parallel, you open 3 file descriptors (at least). Modern machines
can very well read 3 files in parallel, so you won't be seeking around as
much as you think.

I just don't think that application-wise there's something you can do, at
least in this case.

Shai

On Wed, Jul 22, 2009 at 8:15 PM, tsuraan <tsur...@gmail.com> wrote:

> > It's not accurate to say that Lucene scans the index for each search.
> > Rather, every Query reads a set of posting lists, each are typically read
> > from disk. If you pass Query[] which have nothing to do in common (for
> > example no terms in common), then you won't gain anything, b/c each Query
> > will already read just the posting lists it needs.
>
> That sounds like a lot of disk seeking, if the terms associated with
> each query don't happen to fall in exact order.  My disks can sustain
> 100+ MB/s sequential read, but if they're seeking that number
> plummets.  Would it be possible to order the queries so that they can
> each read their index information in order, to minimize thrashing?
>
> > If your Query[] contains the exact Query, it's redundant to run all these
> > searches, since they will return the same results every time.
>
> I'm assuming that the queries being run are different.  Caching query
> results would be pretty easy for us though, so if the queries aren't
> different, they could be made to be.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>

Reply via email to