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

  • Home
  • SEARCH
  • 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 6763207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:26:55+00:00 2026-05-26T14:26:55+00:00

Version1 class ActionLog(db.Model): action = db.StringProperty() time_slice = db.IntegerProperty() trace_code = db.StringProperty() # which

  • 0

Version1

class ActionLog(db.Model):
    action = db.StringProperty()
    time_slice = db.IntegerProperty()
    trace_code = db.StringProperty()    # which profile this log belong to

    # Who
    facebook_id = db.StringProperty()   # the user's facebook id
    ip = db.StringProperty()            # the user's ip address

    # When
    time = db.DateTimeProperty(auto_now_add=True)   # the time of this event

    # What
    url = db.StringProperty()           # the imgurl
    secret = db.StringProperty()        # the secret of imgurl instance
    tag = db.StringProperty()           # the tag
    referurl = db.StringProperty()      # the tag's link

    # Where
    weburl = db.StringProperty()        # the user's refer url
    domain = db.StringProperty()        # the refer url's domain
    BSP = db.StringProperty()           # the refer url's BSP

#execute
log = ActionLog(action=action,
        trace_code=trace_code,
        facebook_id=facebook_id,
        ip=ip,
        time_slice=time_slice,
        url=url,
        secret=secret,
        tag=tag,
        referurl=referurl,
        weburl=weburl,
        domain=domain,
        BSP=BSP)

db.put(log)

Version 2

class ActionLog(db.Model):
    trace_code = db.StringProperty()
    url = db.StringProperty()
    secret = db.StringProperty()

    # use a dict like text property to store all implicit properties.
    desp = MyDictProperty() 
    time = db.DateTimeProperty(auto_now_add=True)   # the time of this event

#execute
log = ActionLog(
                    secret = secret,
                    url = url,
                    trace_code = trace_code,
                    desp = {
                            'action':action,
                            'facebook_id':facebook_id,
                            'ip':ip,
                            'tag':tag,
                            'referurl':referurl,
                            'weburl':weburl,                            
                            }
                    )

db.put(log)

These two versions of code basically do the same task, however, the version 1 code will use more than 800ms to perform a simple put operation (a yellow or red light) CPU time on google app engine. In the contract, the version 2 code only use about 300ms. (Both test on HRD datastore)

On M/S Datastore, the version 1 code will use about 400ms and version 2 code will use about 150ms.

I can image that the version 1 will be slower compare to version 2, since it use more key index. However, it is hard to believe that the difference is so huge. It is also surprising that Google app engine cannot handle such a easy task.

Does that mean we cannot expect GAE to perform insert on data with more than 10 properties
or do I misunderstand anything?

thx

  • 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-05-26T14:26:55+00:00Added an answer on May 26, 2026 at 2:26 pm

    Set index=False on all properties that you don’t need indexed (i.e., properties that you won’t use in a query). This cuts down the number of index writes it takes to save an entity.

    See http://code.google.com/appengine/docs/python/datastore/queries.html#Introduction_to_Indexes for an explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data structure that looks like this (simplified version) class A(models.Model): a
I have the SQL2008 version of SMO and although it uses this class internally
Here is a simplified version of one of my models: class ImportRule(models.Model): feed =
I have the following tables defined declaratively (very simplified version): class Profile(Base): __tablename__ =
There's a class which is compiled into a dll //HeaderFile.h //version 1.0 class __declspec(dllexport)
I have a template class that I serialize (call it C), for which I
I have this class from Ian Selby. Let's say I have a 1024x768 image.
I have a base class which has a method for moving files to appropriate
I suppose that a program like this... class Test { public static void main(String[]
My code looks sort of like this, but this is a simplified version: class

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.