how many db ops does it cost when accessing a ndb entity with a StructuredProperty?

45 views
Skip to first unread message

saintthor

unread,
Jun 24, 2012, 8:40:15 AM6/24/12
to google-a...@googlegroups.com
are there a more ops for the StructuredProperty?

Guido van Rossum

unread,
Jun 24, 2012, 3:54:56 PM6/24/12
to google-a...@googlegroups.com
On Sunday, June 24, 2012 5:40:15 AM UTC-7, saintthor wrote:
are there a more ops for the StructuredProperty?

StructuredProperty is essentially just a bunch of properties with funny names. The cost depends on how many indexed properties you have in total in an entity (including in structured properties). So e.g. these two (Flat and Nested) below have the same cost:

class Flat(ndb.Model):
  name = ndb.StringProperty()
  address_line1 = ndb.StringProperty()
  address_line2 = ndb.StringProperty()

and

class Addres(ndb.Model):
  line1 = ndb.StringProperty()
  line2 = ndb.StringProperty()

class Nested(ndb.Model):
  name = ndb.StringProperty()
  address = ndb.StructuredProperty(Address)

saintthor

unread,
Jun 25, 2012, 8:52:01 AM6/25/12
to google-a...@googlegroups.com
thank you. it is good.

在 2012年6月25日星期一UTC+8上午3时54分56秒,Guido van Rossum写道:
Reply all
Reply to author
Forward
0 new messages