开发者

What's faster Model.get(keys) or Model.get_by_id(ids, parent=None)

开发者 https://www.devze.com 2022-12-24 06:43 出处:网络
I\'m wondering is there a d开发者_JAVA技巧ifference in terms of computing cost for the Model.get(keys) and Model.get_by_id(ids, parent=None) methods?

I'm wondering is there a d开发者_JAVA技巧ifference in terms of computing cost for the Model.get(keys) and Model.get_by_id(ids, parent=None) methods?

Is there a server side computing advantage of using numeric id's over encoded string keys, or other way around? How big is the difference?

PS. Sorry if it's a dupe. I'm sure I read an article about it, but I cannot find it now.


No. Model.get_by_id and Model.get are both simply syntactic sugar for db.get(). There's no substantial difference between passing in encoded string keys or numeric IDs, but your users may find one more friendly than the other if you're passing them around in URLs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号