Reputation: 1745
Would limiting a query to one (or more) result(s) have any noticeable impact on the performance?
For example:
q := datastore.NewQuery("User").Filter("Name =", uniqueUsername)
vs.
q := datastore.NewQuery("User").Filter("Name =", uniqueUsername).Limit(1)
Upvotes: 0
Views: 85
Reputation: 20920
In this case, if there is only one entity that matches the query, I wouldn't expect to see any difference in those two queries. (But feel free to try it out for yourself to find out!)
Upvotes: 1