I have a root entity Account:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Account implements Serializable{
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

        @Persistent
        private String title;

        @Persistent
        private Date createdDate;

        @Persistent(mappedBy = "account")
        @Order(extensions = @Extension(vendorName="datanucleus", key="list-
ordering", value="key asc"))
    private List<Contact> contacts;

        @Persistent(mappedBy = "account")
        @Order(extensions = @Extension(vendorName="datanucleus", key="list-
ordering", value="key asc"))
    private List<Label> labels;

        @Persistent(mappedBy = "account")
        @Order(extensions = @Extension(vendorName="datanucleus", key="list-
ordering", value="key asc"))
    private List<Task> tasks;

        @Persistent(mappedBy = "account")
        @Order(extensions = @Extension(vendorName="datanucleus", key="list-
ordering", value="key asc"))
    private List<Note> notes;

    //other owned child collections
}

Task entity:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Task {
        @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

        @Persistent
        private Text task;

        @Persistent
        private Date dueDate;

        @Persistent
        private Key createdByContact;

        @Persistent
        private Key responsibleContact;

        @Persistent
        private Key attachedContact;

        @Persistent
        private Key attachedProject;

        @Persistent
        private boolean completed;

        @Persistent
        private Key completedByContact;

        @Persistent
        private Date completedDate;

        @Persistent
        private Key category;

        @Persistent
        private Date createdDate;

        @Persistent
        private Account account;

    @Persistent
    @Extension(vendorName="datanucleus", key="gae.parent-pk",
value="true")
    private Key accountKey;
}

Task entity indexes (this entity has the most indexes):

attachedContact ▲ , completed ▲ , completedDate ▼
Includes ancestors

attachedContact ▲ , completed ▲ , dueDate ▲
Includes ancestors

attachedProject ▲ , completed ▲ , completedDate ▼
Includes ancestors

attachedProject ▲ , completed ▲ , dueDate ▲
Includes ancestors

completed ▲ , completedDate ▼
Includes ancestors

completed ▲ , dueDate ▲
Includes ancestors

completed ▲ , responsibleContact ▲ , completedDate ▼
Includes ancestors

completed ▲ , responsibleContact ▲ , dueDate ▲
Includes ancestors



On Jan 19, 10:06 pm, Eli Jones <[email protected]> wrote:
> What do you mean by "one custom index on the string field"?
>
> If you have a custom index.. it must be on more than one "property" of the
> model.
>
> How are the parent and child models defined and what are the definitions of
> the relevant custom indexes?  That should help a lot with figuring this out.
>
>
>
> On Tue, Jan 19, 2010 at 3:01 PM, Lucian Baciu <[email protected]> wrote:
> > There is no batch, I'm only inserting one entity.
>
> > For a small group (10 entities) this is the log for an insert of one
> > entity: 883ms 1290cpu_ms 960api_cpu_ms
> > For a large group (4000 entities) this is the log for an insert of one
> > entity: 8724ms 44123cpu_ms 38854api_cpu_ms
>
> > And it does not seem to matter which kind of child entity I'm
> > inserting, the logs are consistent. Even if I'm inserting a small
> > entity with one string and one integer field, and one custom index on
> > the string field I'm still getting the same results.
>
> > Thanks,
> > Lucian
>
> > On Jan 19, 9:52 pm, Robert Kluin <[email protected]> wrote:
> > > Lucian,
>
> > >   How many entities are you batch putting at once?  For those puts
> > > taking 40 _seconds_, are you putting quite a few entities at a time?
>
> > >   How long does it take to put one entity not in a large group?  How
> > > long does it take to put one entity to a large group?
>
> > > Robert
>
> > > On Tue, Jan 19, 2010 at 1:24 PM, Lucian Baciu <[email protected]>
> > wrote:
> > > > I have a root entity and several child entities mapped using owned one
> > > > to many relationships. When a new entity group is created put
> > > > operations in that entity group use reasonable amounts of CPU (1
> > > > second), but as the number of entities in that entity group increase
> > > > so does the CPU used for put operations. Now I'm seeing over 40
> > > > seconds CPU used for put operations on entity groups with over one
> > > > thousand entities. And it continues to increase.
>
> > > > Child entities have few custom indexes (about 5), but this doesn't
> > > > seem to cause the problem, because it takes about the same amount of
> > > > CPU (over 40 seconds) for a put operation on any entity kind, even for
> > > > a first put for a specific entity kind.
>
> > > > I've read all App Engine articles and watched all videos but I still
> > > > can't figure it out. I would really appreciate some help.
>
> > > > Thanks,
> > > > Lucian
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups "Google App Engine" group.
> > > > To post to this group, send email to [email protected]
> > .
> > > > To unsubscribe from this group, send email to
> > [email protected]<google-appengine%2Bunsubscrib 
> > [email protected]>
> > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/google-appengine?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine%2Bunsubscrib 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to