| 1 | [vectordb](../README.md) / [Exports](../modules.md) / CompactionOptions |
| 2 | |
| 3 | # Interface: CompactionOptions |
| 4 | |
| 5 | ## Table of contents |
| 6 | |
| 7 | ### Properties |
| 8 | |
| 9 | - [materializeDeletions](CompactionOptions.md#materializedeletions) |
| 10 | - [materializeDeletionsThreshold](CompactionOptions.md#materializedeletionsthreshold) |
| 11 | - [maxRowsPerGroup](CompactionOptions.md#maxrowspergroup) |
| 12 | - [numThreads](CompactionOptions.md#numthreads) |
| 13 | - [targetRowsPerFragment](CompactionOptions.md#targetrowsperfragment) |
| 14 | |
| 15 | ## Properties |
| 16 | |
| 17 | ### materializeDeletions |
| 18 | |
| 19 | • `Optional` **materializeDeletions**: `boolean` |
| 20 | |
| 21 | If true, fragments that have rows that are deleted may be compacted to |
| 22 | remove the deleted rows. This can improve the performance of queries. |
| 23 | Default is true. |
| 24 | |
| 25 | #### Defined in |
| 26 | |
| 27 | [index.ts:1241](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L1241) |
| 28 | |
| 29 | ___ |
| 30 | |
| 31 | ### materializeDeletionsThreshold |
| 32 | |
| 33 | • `Optional` **materializeDeletionsThreshold**: `number` |
| 34 | |
| 35 | A number between 0 and 1, representing the proportion of rows that must be |
| 36 | marked deleted before a fragment is a candidate for compaction to remove |
| 37 | the deleted rows. Default is 10%. |
| 38 | |
| 39 | #### Defined in |
| 40 | |
| 41 | [index.ts:1247](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L1247) |
| 42 | |
| 43 | ___ |
| 44 | |
| 45 | ### maxRowsPerGroup |
| 46 | |
| 47 | • `Optional` **maxRowsPerGroup**: `number` |
| 48 | |
| 49 | The maximum number of T per group. Defaults to 1024. |
| 50 | |
| 51 | #### Defined in |
| 52 | |
| 53 | [index.ts:1235](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L1235) |
| 54 | |
| 55 | ___ |
| 56 | |
| 57 | ### numThreads |
| 58 | |
| 59 | • `Optional` **numThreads**: `number` |
| 60 | |
| 61 | The number of threads to use for compaction. If not provided, defaults to |
| 62 | the number of cores on the machine. |
| 63 | |
| 64 | #### Defined in |
| 65 | |
| 66 | [index.ts:1252](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L1252) |
| 67 | |
| 68 | ___ |
| 69 | |
| 70 | ### targetRowsPerFragment |
| 71 | |
| 72 | • `Optional` **targetRowsPerFragment**: `number` |
| 73 | |
| 74 | The number of rows per fragment to target. Fragments that have fewer rows |
| 75 | will be compacted into adjacent fragments to produce larger fragments. |
| 76 | Defaults to 1024 * 1024. |
| 77 | |
| 78 | #### Defined in |
| 79 | |
| 80 | [index.ts:1231](https://github.com/lancedb/lancedb/blob/92179835/node/src/index.ts#L1231) |