smith324
smith324

Reputation: 13060

How can I delete the automatic Indexes in App Engine?

So I have a live Python application on App Engine that has far too many automatic indexes. I noticed a high amount of datastore writes for my low entity count and I believe this is the cause. Each entity has many StringProperties and some even have StringListProperties.

I added the indexed = False to all my object's properties (I don't every use a query where this would matter):

someproperty = db.StringProperty(indexed = False)

Is there anything else I need to do for new entities to be unindexed? Do I need to increment the app's version id?

Do I need to run appcfg.py vacuum_indexes . ?

Upvotes: 2

Views: 199

Answers (2)

Riley Lark
Riley Lark

Reputation: 20890

To get rid of the existing automatic indices you will have to retrieve every single entity and re-put it with the indexed = False properties.

If you don't do this, then the automatic indices will stick around. However, the new entities you create will not be added to those indices.

Upvotes: 1

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

vacuum_indexes is only for indexes defined in index.yaml, for automatic index its enough to set indexed = False and uploaded a new version.

You can see the impact of setting indexed to False in the development server datastore page in the write counts column.

Upvotes: 3

Related Questions