Closed crhistianramirez closed 4 years ago
This is totally expected. Your performing a cross partition query against all your documents. Cosmos DB is not designed to perform in this scenario. The explorer works because it returns 100 documents at a time. Cosmonaut abstracts the pagination away and return whatever you tell it to.
Ahh I see. So something like
_cosmos.Query("select * from c").WithPagination(1, 100).ToListAsync();
Might be what I'm looking for?
If you want pagination then yeah. If you’re using the CosmosStore class then simply do _cosmosStore.Query().WithPagination(1, 100).ToListAsync.
Keep in mind however that this is still a cross partition query and it isn’t recommended. You should always use the partition key.
@Elfocrash thank you for your patience and assistance 🙇
We are executing a very simple query on our production database but are seeing a timeout. When we run it locally the memory consumption goes up very high before timing out. In test this was no problem but we didn't have that many documents in there. The production collection is not insignificant but is not super big either, (about 500MB)
When we run this same query in the query explorer on azure it comes back almost instantly. Is there anything you can think of that might be causing such an issue? Is it incorrectly trying to paginate over all documents?
I would appreciate any assistance on this.