Matthew H
Matthew H

Reputation: 5879

db.get() vs db.get_by_key_name() performance (GAE BIgtable/Datastore)

How does the performance of db.get() compare with that of db.get_by_key_name()?

Upvotes: 5

Views: 1248

Answers (2)

Matt Williamson
Matt Williamson

Reputation: 40253

For all intents and purposes they are equivalent.

Upvotes: 4

Alex Martelli
Alex Martelli

Reputation: 882851

get_by_key_name must compute the keys based on app, model, name and parent, so it should consume a (tiny but not null) amount of CPU more than db.get, which needs no computation. However I doubt you can measure the difference in elapsed time, since the fetching from storage will vastly dominate in both cases.

Upvotes: 5

Related Questions