I am fetching all the instances for a given linkname but I want to call all their values(rating2) to perform a calculation, I debugged and all my time is in the query and fetch lines, I only have a table with 100 items and it is taking 2 seconds!!!!! How can it be this slow to fetch a few items out of a 100 item table and how can I speed this up? I am running this in the command console and calling the appengine_console.py and running my script that way, is it possible that would cause any sort of delay?
class LinkRating2(db.Model):
user = db.StringProperty()
link = db.StringProperty()
rating2 = db.FloatProperty()
def sim_distance(link1,link2,tabl):
# Get the list of shared_items
si={}
query = tabl.all()
query2 = tabl.all()
a = query.filter('link = ', link1)
b = query2.filter('link = ', link2)
adic ={}
bdic= {}
aa = a.fetch(10000)
bb = b.fetch(10000)
UPDATE/EDIT Hi guys, I put a call to the sim distance function on my main loading page, I am calling sim_distance thousands of times in another function and to my amazement it is taking only 15ms to execute! Here is what I don't understand, why does it take 2 seconds per call when I am running it in the appengine_console.py in the command window? I took an hour to run in the cmd window but instantaneously about when running it from explorer window.