Hi,
I have written a new overload of GetDocumentsWithIdStartingWith method which is faster than the original. This overload takes lastReadId instead of start parameter:
public IEnumerable<JsonDocument> GetDocumentsWithIdStartingWith(string idPrefix, string lastReadId, int take)
Reading 200000 documents with a page size of 1000 documents using ESENT takes nearly half time. The culprit of such a improvement is this piece of code that can be avoided:
while (start > 0)
{
if (Api.TryMoveNext(session, Documents) == false)
return Enumerable.Empty<JsonDocument>();
start--;
}
I added the new overload to IDocumentStorageActions interface, implemented the method in both Raven.Storage.Managed.DocumentsStorageActions and Raven.Storage.Esent.StorageActions. I also added the method to Raven.Database.DocumentDatabase class.
Questions:
Would you accept a pull request?
Which additional classes would I need to modify to expose the new overload at the client side?
Thanks.