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 hawk <ha...@welikev.com> on 2017/08/24 08:21:17 UTC
Slow when query with cursorMark
Hi,
Our system is running query with paging, when the page no increase, the query time takes more time. I found that in the Solr document, it provides the cursor mark functionality to optimize the performance of deep paging.
But I found the query using normal paging (start and rows) is much faster than cursor.
1. the query below takes 5 ms
http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json <http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json>
2. the query below takes 63 ms
http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json&cursorMark=* <http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json&cursorMark=*>
May I know what is the reason for the difference, dose the Cursor need more time for some specific logic?
Best Regards
Hawk
Re: Slow when query with cursorMark
Posted by Chris Hostetter <ho...@fucit.org>.
: I would guess that your first query is hitting the queryResultCache.
yeah, that's almost certainly why you're seeing the "page#0" query be so
fast -- but IIRC the cursorMark pages can't be cached in the same way?
where you'll start to see significant speed ups is in in the subsequent
"pages"...
https://lucidworks.com/2013/12/12/coming-soon-to-solr-efficient-cursor-based-iteration-of-large-result-sets/
-Hoss
http://www.lucidworks.com/
Re: Slow when query with cursorMark
Posted by Erick Erickson <er...@gmail.com>.
I would guess that your first query is hitting the queryResultCache.
Getting a 5ms response time is highly suspicious, there are very few
queries that take that little time to execute unless they're just
hitting that cache.
Best,
Erick
On Thu, Aug 24, 2017 at 1:21 AM, hawk <ha...@welikev.com> wrote:
> Hi,
>
> Our system is running query with paging, when the page no increase, the query time takes more time. I found that in the Solr document, it provides the cursor mark functionality to optimize the performance of deep paging.
>
> But I found the query using normal paging (start and rows) is much faster than cursor.
>
> 1. the query below takes 5 ms
> http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json <http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json>
>
> 2. the query below takes 63 ms
> http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json&cursorMark=* <http://localhost:8900/solr/taoke/select?&q=_title_:(*)&q.op=AND&start=0&rows=5&sort=sortDate%20desc,weight%20desc,createTime%20desc,ID%20desc&fq=disabled:false&fq=-quanType:2&fq=Cid:7&wt=json&cursorMark=*>
>
> May I know what is the reason for the difference, dose the Cursor need more time for some specific logic?
>
> Best Regards
> Hawk