Extremely poor performance of query to get top 25 rows
We are using paging to avoid loading all records at same time. However, when we execute the query to get top 25 rows, it still returns all the rows (6000) and shows 25. But then it makes no sense since it's taking around 44 seconds for first query. How to optimize it?
sample query is below. First query execution time is 44 sec. Subsequent is around 5. But still seems v high for such a query. Anything we need to change here to speed it up?
path=/content/imf/publishedDocuments
type=nt:unstructured
orderby=@documentDate
orderby.sort=desc
p.offset=0
p.limit=25