lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-2335) optimization: when sorting by field, if index has one segment and field values are not needed, do not load String[] into field cache
Date Mon, 22 Mar 2010 21:55:27 GMT


Michael McCandless commented on LUCENE-2335:

bq. The sort-first-then-resolve-Strings is what I did in the proof of concept. The speed is
that of TermsInfoReader, where it delivers a Term from a given position. If this is too slow
for multiple segments, the segment-spanning ordered ordinals-approach could be tried.

I fear both approaches are too slow.  (This is why we have the
per-docXfield String values RAM resident now).

bq. As for deprecating stored fields, then I guess there's the issue of spatial locality.
Wouldn't moving the bytes into the inverted term index bloat it in a way that makes all searches

We're not planning on deprecating stored fields?

bq. There's an issue of having multiple terms in the same field for a given document, which
also ties into facets.

For sorting it must be a single term right?

Also, for facets, you have to visit all docs, aggregating, not just
the final top N in the queue?

Facets are fun to discuss... but let's keep this issue focused on how
to optimize the single-segment sorting case with fillFields=false.

> optimization: when sorting by field, if index has one segment and field values are not
needed, do not load String[] into field cache
> ------------------------------------------------------------------------------------------------------------------------------------
>                 Key: LUCENE-2335
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Michael McCandless
>            Priority: Minor
>             Fix For: 3.1
> Spinoff from java-dev thread "Sorting with little memory: A suggestion", started by Toke
> When sorting by SortField.STRING we currently ask FieldCache for a StringIndex on that
> This can consumes tons of RAM, when the values are mostly unique (eg a title field),
as it populates both int[] ords as well as String[] values.
> But, if the index is only one segment, and the search sets fillFields=false, we don't
need the String[] values, just the int[] ords.  If the app needs to show the fields it can
pull them (for the 1 page) from stored fields.
> This can be a potent optimization -- alot of RAM saved -- for optimized indexes.
> When fixing this we must take care to share the int[] ords if some queries do fillFields=true
and some =false... ie, FieldCache will be called twice and it should share the int[] ords
across those invocations.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message