Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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()?

like image 754
Matthew H Avatar asked Aug 08 '10 03:08

Matthew H


2 Answers

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.

like image 106
Alex Martelli Avatar answered Sep 25 '22 06:09

Alex Martelli


For all intents and purposes they are equivalent.

like image 32
Matt Williamson Avatar answered Sep 22 '22 06:09

Matt Williamson