# Create Copystorm Indexes

CopyStorm/Restore will perform parent/child record analysis much faster if the CopyStorm database foreign keys are fully indexed.

To create the necessary indexes, check the [“Create Indexes” checkbox](https://learn.capstorm.com/copystorm/readme/reference/configuration-tab/database-indexing) on CopyStorm’s Configuration tab and rerun CopyStorm.

![](https://2924009365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5FyPmqVkPxhj2oT8fbgB%2Fuploads%2Fgit-blob-96402834df458c8702112d90567a31206c6f70b8%2F3040481e-CopyStormIndexes-1.png?alt=media)

## What Happens if Indexes Are Not Created?

CopyStorm/Restore will still work without indexes but the analysis required to determine the order in which records must be restored will be much slower. For databases with millions of rows the performance is likely to be unbearable. This is because CopyStorm/Restore needs to do a lot of table scans by running queries like:

* `SELECT id FROM Contact WHERE accountId IN (….)`

These will cause the entire Contact table to be scanned (an Order(n) operation). After creating the indexes, each lookup is an Order(1) operation (e.g. 1000s of times faster).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/copystorm-restore/best-practices/create-copystorm-indexes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
