Why is the _id a uuid #148
Replies: 2 comments 1 reply
-
Hey, @singersbalm, you are right, that check can be skipped. |
Beta Was this translation helpful? Give feedback.
-
Forgive me, but this smells a bit like premature optimization. I have been running benchmarks, and unless you have several hundreds of thousands of users, the difference between using _ := db.CreateIndex("users", "Email")
docs, _ := db.FindAll(query.NewQuery("users").Where(query.Field("Email").Eq("[email protected]")) and accessing them via their ID field is negligible. Looking up users via index yielded the following results
Mind you - that is lookups per second. Also note: Most of the 11 minutes was spent on creating the several hundred K users. The data model was simple, as we wanted to test the lookup, not the retrieval: type User struct {
Name string
Email string
} Bottom line: It is highly unlikely that the lookup will have any significant impact when compared to actually loading the data. From my point of view, using a non-customizable |
Beta Was this translation helpful? Give feedback.
-
Why can't I define a custom _id?. I tried to define a users collection with the email as _id to improve lookup performance.
Clover only allows uuids, but why. what's the benefit? Shouldn't that check be optional?
Beta Was this translation helpful? Give feedback.
All reactions