# PersistentCacheIndexManager

# PersistentCacheIndexManager


```
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/kotlin/com/google/firebase/firestore/FirebaseFirestore#getPersistentCacheIndexManager()`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/firestore/PersistentCacheIndexManager#deleteAllIndexes()()` Removes all persistent cache indexes. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/firestore/PersistentCacheIndexManager#disableIndexAutoCreation()()` Stops creating persistent cache indexes automatically for local query execution. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://firebase.google.com/docs/reference/kotlin/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 functions

### deleteAllIndexes

```
fun deleteAllIndexes(): Unit
```

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

### disableIndexAutoCreation

```
fun disableIndexAutoCreation(): Unit
```

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

### enableIndexAutoCreation

```
fun enableIndexAutoCreation(): Unit
```

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.