Re: [google-appengine] Datastore write costs

268 views
Skip to first unread message

Takashi Matsuo

unread,
Dec 21, 2012, 7:34:38 PM12/21/12
to google-a...@googlegroups.com

Hi Ryan,

Can you tell me how you configure that property to be unindexed, or even share the reproducible code? It seems odd to me. 


On Fri, Dec 21, 2012 at 1:29 PM, Ryan Chazen <rya...@gmail.com> wrote:
Hi - I find the following a bit confusing - is it correct?

Using unindexed properties only:

If I write 10 numbers in a list to the datastore, _ah/admin on the local dev server shows 10 write operations.
If I write 10 numbers inside an embedded entity (or comma delimited), the local dev server shows 1 write operation.

Since billing is by write operations, is using the list 10x more expensive in reality? If so, I need to make sure all of my unindexed properties get put into an embedded entity first before writing as it will mean I only use 1 write op for all unindexed properties...

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/QCKq6AsCL48J.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Takashi Matsuo | Developers Advocate | tma...@google.com

vlad

unread,
Dec 23, 2012, 2:45:44 PM12/23/12
to google-a...@googlegroups.com
My understanding is UNINDEXED properties add no write cost at all. See https://developers.google.com/appengine/docs/python/datastore/entities#Understanding_Write_Costs

Andreas Schmid

unread,
Dec 26, 2012, 7:27:47 AM12/26/12
to google-a...@googlegroups.com
even if a property is not indexed is needs to be written to the datastore so it costs 1 write instead of 2 (one to the datastore and one to the index).
a list property adds 1 write per item for example + another one for each one if they are indexed.

vlad UNEXISTING props do not add any write cost ;)

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/CGmpJvoIF_EJ.

Arie Ozarov

unread,
Dec 26, 2012, 3:45:31 PM12/26/12
to google-a...@googlegroups.com


On Wednesday, December 26, 2012 4:27:47 AM UTC-8, aschmid wrote:
even if a property is not indexed is needs to be written to the datastore so it costs 1 write instead of 2 (one to the datastore and one to the index).
We also charge an extra 1 write operation per entity (and only for new entities) for the kind index.

John Patterson

unread,
Dec 26, 2012, 11:44:18 PM12/26/12
to google-a...@googlegroups.com


On Thursday, 27 December 2012 01:27:47 UTC+13, aschmid wrote:
even if a property is not indexed is needs to be written to the datastore so it costs 1 write instead of 2 (one to the datastore and one to the index).


Unindexed properties do not cost anything to write.  They are included in the one write operation that writes the entity data.  Basically, all properties are serialised and written as a single opaque unit.  It costs no more to write 1000 unindexed properties as 1 - however the latency to read and write will be higher which will cost you in terms of instance hours.

An indexed property costs 2 writes because each index (ASC, DESC) is a separate write.
 
 
vlad UNEXISTING props do not add any write cost ;)


What do you mean by UNEXISTING?  Be careful here because null values will also cost 2 writes if they are indexed.

Twig (prob also Objectify) can be configured store null values as indexed or not indexed (also or stored or not stored) while still storing non-null values.

phantom river

unread,
Oct 7, 2013, 9:47:22 AM10/7/13
to google-a...@googlegroups.com
every entity requires two writes, plus, every indexABLE value requires two writes.

Reply all
Reply to author
Forward
0 new messages