put()
來儲存資料時),這是因為在儲存或更新資料時,datastore 也會針對這些 property 作一些 index 的動作,使得整個操作的時間變長。如果確定不會用某個 property 來作資料查詢 filter 的條件,那麼可以在定義 property 時加上
indexed=False
參數,提示 datastore 這個 property 不要做 index,範例程式如下:from google.appengine.ext import db
class Foo(db.Model):
....
bar = db.StringProperty(indexed=False)
沒有留言:
張貼留言