# PersistentCacheIndexManager

# PersistentCacheIndexManager


```
public final class PersistentCacheIndexManager
```

<br />

*** ** * ** ***

Persistent cache indexes can improve performance of local query execution. The `
PersistentCacheIndexManager` controls index creation and lifecycle.

This is not the same as Cloud Firestore Indexes. Persistent cache indexes are optional indexes that only exist within the SDK to assist in local query execution.

To get an instance, call `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore#getPersistentCacheIndexManager()`.

## Summary

| ### Public methods |
|---|---|
| `void` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/PersistentCacheIndexManager#deleteAllIndexes()()` Removes all persistent cache indexes. |
| `void` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/PersistentCacheIndexManager#disableIndexAutoCreation()()` Stops creating persistent cache indexes automatically for local query execution. |
| `void` | `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/PersistentCacheIndexManager#enableIndexAutoCreation()()` Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improves performance. |

## Public methods

### deleteAllIndexes

```
public void deleteAllIndexes()
```

Removes all persistent cache indexes. Note this function also deletes indexes generated by `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore#setIndexConfiguration(java.lang.String)`, which is deprecated.

### disableIndexAutoCreation

```
public void disableIndexAutoCreation()
```

Stops creating persistent cache indexes automatically for local query execution. The indexes which have been created by calling `https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/PersistentCacheIndexManager#enableIndexAutoCreation()` still take effect.

### enableIndexAutoCreation

```
public void enableIndexAutoCreation()
```

Enables the SDK to create persistent cache indexes automatically for local query execution when the SDK believes cache indexes can help improves performance.

This feature is disabled by default.