# Database Optimization

The Database Query Optimization Parameter Editor controls optimizations used when generating SQL queries for the CopyStorm database.

![](/files/eg5O29dxtSNT5KwG2B6R)

| Parameter Name               | Default Setting | Required | Description                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Optimize Insert SQL          | Unchecked       | No       | If checked, CopyStorm will not include NULL data in generated INSERT statements. For wide tables with many NULL values this may be considerably faster than unoptimized INSERT statements.                                                                                                                                                                                         |
| Optimize Update SQL          | Checked         | No       | If checked, CopyStorm will compare data from Salesforce with existing data in the CopyStorm database and build minimal SQL UPDATE statements. For wide tables with few changes this may be considerably faster than unoptimized UPDATE statements.                                                                                                                                 |
| Optimize Timestamps          | Checked         | No       | If checked, then use the time of the most recently complete CopyStorm job to reduce the number of records read from Salesforce. If not checked, then the timestamp of the newest record in Salesforce is used to build SOQL queries, and at least one record from each table will always be read.                                                                                  |
| Force Updates                | Unchecked       | No       | If checked, CopyStorm will write all records read from Salesforce to the target database. Records will be updated even if the timestamp is the same as the Salesforce timestamp. This option can be used in conjunction with the “Modified Since” and “Modified Thru” parameters to force CopyStorm to re-read records from Salesforce and update any fields that are out of sync. |
| Optimize Deleted Record Scan | Checked         | No       | If checked then CopyStorm will use information from the previous backup to minimize the number of records scanned when searching for deleted records. This option is ignored if the Delete Older Than option is blank.                                                                                                                                                             |
| Update Using DELETE/INSERT   | Unchecked       | No       | If checked then CopyStorm will UPDATE records by first deleting them and the re-inserting them. This option is ignored if the Optimize Update SQL option is checked.                                                                                                                                                                                                               |


---

# 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/reference/configuration-tab/database-optimization.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.
