You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Matt Kent <ma...@pressflip.com> on 2008/11/06 20:57:35 UTC

how to improve cold sort time?

Hey all,

I'm working on optimizing my query times, and I was wondering if there's any
secrets to improving sort time. Let me emphasize that I'm working on
__cold__ query times. I'm intentionally trying to simulate cache misses and
I'm aware that caching would improve my times greatly. Here's my situation:

I'm using the all query *:* with a few filter queries (type:stuff,
userId:12345, category:3, etc). Without sorting, my query takes about 600ms,
which is fine for me. My target range is 500-1000ms. When I add a sort
field, my query takes about 53,000ms, which seems ridiculous. The field I'm
sorting on is a sortable long with omitNorms=true. My index has around 2M
docs and my configuration is the default.

Is this simply the initial price to pay for using a sort field, or is there
any way I can improve my cold query time?

Matt

Re: how to improve cold sort time?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Nov 7, 2008 at 1:27 AM, Matt Kent <ma...@pressflip.com> wrote:

> I'm using the all query *:* with a few filter queries (type:stuff,
> userId:12345, category:3, etc). Without sorting, my query takes about
> 600ms,
> which is fine for me. My target range is 500-1000ms. When I add a sort
> field, my query takes about 53,000ms, which seems ridiculous. The field I'm
> sorting on is a sortable long with omitNorms=true. My index has around 2M
> docs and my configuration is the default.
>
> Is this simply the initial price to pay for using a sort field, or is there
> any way I can improve my cold query time?


You can try to put a sort query in the newSearcher/firstSearcher event so
that the FieldCache for the long field is created and kept ready for
subsequent searches. This should help.

-- 
Regards,
Shalin Shekhar Mangar.