To avoid automatic property index creation with JDO use the following
on properties you don't want indexed.
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
One caveat is that if you plan to use that property as a composite
index then you'll need to have that property indexed. Unindexed
properties/fields can't be used as part of a composite index.
Also, to reduce you database usage, make sure to use short entity
names (I use 2 letter names) and short property names (I use 3
letter). For properties you can use
@Column(name="abc")
to specify a shorter name for the datastore while using a longer name
in your code, thus putting it all together it will look like
@Persistent
@Column(name="abc")
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
private int
heyIAmAReallyLongNameButWhoCaresCuzTheDatastoreWillUseTheShortName =
0;
As for your #2 question, I'm not sure what you may have been
experiencing there. But as a warning if you do lots and lots and lots
and lots of deletes you can run in to a situation where there are so
many soft deleted entries in your indexes that when you query the
index the query will timeout because it needs to scan past all those
entries. This has happened to people for example that have deleted all
the entries in a particular entity kind and then aren't able to query
for a period of time. No one but the Googlers really know what's going
on at the lowest levels and so it's kind of a black box at figuring
out some of these side effects that you might encounter. Let me know
if you have any other questions and I'll do my best to try to help out
as will others I'm sure.
Stephen
On Wed, Jul 6, 2011 at 4:05 AM, BarrenTeam <[email protected]> wrote:
> Thank you Stephen.
> Yes we do many updates in our app, probably we fill the datastore because of
> the soft delete, indeed after at least 24 hours we have in the datastore
> about 3% of storage data.
> We also think that the indexs waste many storage quota.
> Thus, we have two more questions:
> 1) We use JDO. How do we do to avoid the automatic creation of indexes?
> 2) When we did deletes and inserts instead of updates the storage data quota
> remained constant. Why?
>
> --
> 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/-/LAjhJyp4lPEJ.
> 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.
>
--
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.