Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does RavenDB internally optimise "get document by id" type of queries?

Tags:

c#

ravendb

When performing a dynamic query, RavenDB will typically create a temp index.

Retrieving document by its Id doesn't trigger this behaviour:

var entity = documentSession.Query<Entity>().Single(x => x.Id == 1);

Does RavenDB have a built-in optimisation for this type of query?

like image 680
Arnold Zokas Avatar asked Jan 30 '12 02:01

Arnold Zokas


2 Answers

Arnold, No, it does not optimize this behavior.

like image 91
Ayende Rahien Avatar answered Sep 27 '22 22:09

Ayende Rahien


Your assumption is wrong, because it will create a temp index. If your example its name should be "Temp/Entities/By__document_id"

like image 36
Daniel Lang Avatar answered Sep 27 '22 22:09

Daniel Lang