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 Pawel Rog <pa...@gmail.com> on 2014/06/30 14:25:42 UTC

createNormalizedWeight

Hi,
I'm running queries over memory index and see in profiler significant CPU
usage on method createNormalizedWeight. Most of the time is spent on
rewrite method.

Is it any way to avoid it or optimize to reduce CPU usage on
createNormalizedWeight? Scoring is not important for me at all. It only
want to know if query matches do document or not.

--
Regards,
Paweł

Re: createNormalizedWeight

Posted by Pawel Rog <pa...@gmail.com>.
Hi,
Is there any way to pre-build rewritten queries and cache them somewhere.
When I have a set of queries which is used very frequently I would get
significant boost (10-20% of CPU wasted) when I can skip rewriting (for
example by caching rewritten queries).
Thank you for any suggestions.


On Mon, Jun 30, 2014 at 3:24 PM, Pawel Rog <pa...@gmail.com> wrote:

> Hi,
> Thank you Uwe. I see mostly ConstantScoreQuery, BooleanQuery and
> FilteredQuery. Maybe it is quite cheap for MI but I execute quite many
> queries on it and I was looking for optimizations.
>
> --
> Paweł
>
>
> On Mon, Jun 30, 2014 at 3:01 PM, Uwe Schindler <uw...@thetaphi.de> wrote:
>
>> Hi,
>>
>> Queries have to be rewritten, this has nothing to do with scoring. What
>> type of queries are you seeing this? Wildcard or text ranges are expensive,
>> there is no way around, but for MemoryIndex (I assume you mean this class),
>> this should be quite cheap.
>>
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>>
>>
>> > -----Original Message-----
>> > From: ppp.pawelrog@gmail.com [mailto:ppp.pawelrog@gmail.com] On
>> > Behalf Of Pawel Rog
>> > Sent: Monday, June 30, 2014 2:26 PM
>> > To: java-user@lucene.apache.org
>> > Subject: createNormalizedWeight
>> >
>> > Hi,
>> > I'm running queries over memory index and see in profiler significant
>> CPU
>> > usage on method createNormalizedWeight. Most of the time is spent on
>> > rewrite method.
>> >
>> > Is it any way to avoid it or optimize to reduce CPU usage on
>> > createNormalizedWeight? Scoring is not important for me at all. It only
>> want
>> > to know if query matches do document or not.
>> >
>> > --
>> > Regards,
>> > Paweł
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Re: createNormalizedWeight

Posted by Pawel Rog <pa...@gmail.com>.
Hi,
Thank you Uwe. I see mostly ConstantScoreQuery, BooleanQuery and
FilteredQuery. Maybe it is quite cheap for MI but I execute quite many
queries on it and I was looking for optimizations.

--
Paweł


On Mon, Jun 30, 2014 at 3:01 PM, Uwe Schindler <uw...@thetaphi.de> wrote:

> Hi,
>
> Queries have to be rewritten, this has nothing to do with scoring. What
> type of queries are you seeing this? Wildcard or text ranges are expensive,
> there is no way around, but for MemoryIndex (I assume you mean this class),
> this should be quite cheap.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: ppp.pawelrog@gmail.com [mailto:ppp.pawelrog@gmail.com] On
> > Behalf Of Pawel Rog
> > Sent: Monday, June 30, 2014 2:26 PM
> > To: java-user@lucene.apache.org
> > Subject: createNormalizedWeight
> >
> > Hi,
> > I'm running queries over memory index and see in profiler significant CPU
> > usage on method createNormalizedWeight. Most of the time is spent on
> > rewrite method.
> >
> > Is it any way to avoid it or optimize to reduce CPU usage on
> > createNormalizedWeight? Scoring is not important for me at all. It only
> want
> > to know if query matches do document or not.
> >
> > --
> > Regards,
> > Paweł
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

RE: createNormalizedWeight

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

Queries have to be rewritten, this has nothing to do with scoring. What type of queries are you seeing this? Wildcard or text ranges are expensive, there is no way around, but for MemoryIndex (I assume you mean this class), this should be quite cheap.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: ppp.pawelrog@gmail.com [mailto:ppp.pawelrog@gmail.com] On
> Behalf Of Pawel Rog
> Sent: Monday, June 30, 2014 2:26 PM
> To: java-user@lucene.apache.org
> Subject: createNormalizedWeight
> 
> Hi,
> I'm running queries over memory index and see in profiler significant CPU
> usage on method createNormalizedWeight. Most of the time is spent on
> rewrite method.
> 
> Is it any way to avoid it or optimize to reduce CPU usage on
> createNormalizedWeight? Scoring is not important for me at all. It only want
> to know if query matches do document or not.
> 
> --
> Regards,
> Paweł


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