datastore remove index


Cloud Datastore imposes limits on the number and overall size of index entries that can be associated with a single entity. These limits are large, and most applications are not affected. However, there are circumstances in which you might encounter the limits.

Types of Datastore index

datastore composite indices
Datastore composite indices

Built-in indexes

By default, Cloud Datastore automatically predefines an index for each property of each entity kind. These single property indexes are suitable for simple types of queries.

Composite indexes

Composite indexes index multiple property values per indexed entity. Composite indexes support complex queries and are defined in an index configuration file (index.yaml).

Cost Counting for Datastore write

In the current pricing model, inserting a new entity costs
2 write operations for the entity + 2 write operations per index.
here index may be the composite index or built-in index ( single property index).
You can remove composite index using either gcloud tool or appcfg


Remove composite Datastore index

To remove composite index just update the index file and run appcfg command with vacuum_index as argument 
appcfg.py -A <project-name> vacuum_indexes <directory>

<diretory> : directory that contains the index.yaml file for your project
Notice that this will only remove the composite index ( indices defined in the index.ymal ) file.




Remove Property based  Datastore index 

To remove the index from the individual property you have to remove the index from each and every record in the Datastore
  Remove property index
Remove property index

I don't find another fast and efficient way to remove the index from individual property with existing data

Comments

Popular Posts