Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8441551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:35:23+00:00 2026-06-10T08:35:23+00:00

I have a model: class MyModel(db.Model): some_list = db.StringListProperty(indexed=True) some_value = db.StringProperty(indexed=True) and a

  • 0

I have a model:

class MyModel(db.Model):
  some_list = db.StringListProperty(indexed=True)
  some_value = db.StringProperty(indexed=True)

and a composite index:

indexes:
- kind: MyModel
  properties:
  - name: some_list
  - name: some_value

If I create a new entity:

entity = MyModel(some_list=['a', 'b'], some_value='xxx')

then I put it into the datastore:

key = entity.put()

This will result in

  • 2 writes (in this case 2 writes)
  • 2 writes per indexed property value (in this case 2 + 4 writes)
  • 1 write per composite index value (in this case 2 writes)

A total of 10 writes in this case. So far I understand the documentation.

But now I get the existing property, add ‘c’ to some_list and put it back:

existing = MyModel.get(key)
existing.some_list.append('c')
existing.put()

How many datastore writes is that?

The documentation says:

1 write + 4 writes per modified indexed property value + 2 writes per modified composite index value

Does this mean the index for ‘a’ and ‘b’ from some_list does not need to be rewritten:

1 + 4 + 2 = 7 writes

Or is the index for ‘a’ and ‘b’ from some_list rewritten because some_list changed:

1 + 12 + 6 = 19 writes

?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:35:25+00:00Added an answer on June 10, 2026 at 8:35 am

    (Without the composite index) appstats shows the following billed_ops:

    For the 1st put:

    @2ms datastore_v3.Put real=169ms api=0ms cost=800 billed_ops=[DATASTORE_WRITE:8]

    • 1 write in the entity table
    • 1 write in the kind index table
    • 2 writes in some_value index table (asc/desc)
    • 4 writes in some_list index table (2 per added value, asc/desc)

    For the 2nd put(update):

    @187ms datastore_v3.Put real=50ms api=0ms cost=300 billed_ops=[DATASTORE_WRITE:3]

    • 1 write in the entity table
    • 2 writes in some_list index table (2 per added value, asc/desc)

    The doc says 4 writes per modified indexed property value but since each of the list property element has its own index row (1 row per value), adding an element is equivalent to creating new indexed property (not modifying one).

    However if you modify some_value, this will result in:

    @484ms datastore_v3.Put real=46ms api=0ms cost=500 billed_ops=[DATASTORE_WRITE:5]

    • 1 write in the entity table
    • 4 writes in some_value index table (2 writes for deleting existing row asc/desc, 2 writes for adding a new row asc/desc)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model: class MyModel(models.Model): id = models.IntegerField(primary_key=True) recorded_on = models.DateField() precipitation =
I have a model similar to this: public class myModel { public ClassA ObjectA
I have a model with a datetime field: class MyModel(models.Model): created = models.DateTimeField(auto_now =
in a Model I have a CharField with choices: class MyModel(models.Model): THE_CHOICES=( ('val',_(u'Value Description')),
I have a standard ActiveRecord model with the following: class MyModel < ActiveRecord::Base custom_method
I have a simple Python/Django class: class myModel(models.Model): date = models.DateTimeField() value = models.IntegerField()
I've got a bindable model class (lets call it myModel) with two properties, label
I have a model: public class MyModel { int id { get; set; }
I have the following in my model: class info(models.Model): add = models.CharField(max_length=255) name =
In my model I have: class Log < ActiveRecord::Base serialize :data ... def self.recover(table_name,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.