> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/sort-rows-transformation-step/general-sort-rows-step/options-sort-rows-step.md).

# Options

The Sort rows step includes options to define your output and how you want to sort rows.

| Option                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Sort directory**                              | Select a directory in which temporary files can be stored, if needed. If you leave this blank, the temporary files are stored in the default temporary directory for the system. Click **Browse** to select a different directory.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **TMP-file prefix**                             | Specify a prefix for the temporary files. This helps you identify any files generated by the transformation in the temp directory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Sort size (rows in memory)**                  | Specify the number of rows to sort in memory. A larger number improves the sort speed, since fewer temporary files are generated, consuming less input/output processing. Default is: 1000000 rows.**Note:** You may encounter an Out Of Memory Exception (OOME) if the number of rows in memory exceeds the number specified in this option. To resolve the OOME, either lower the sort size specified here or change your available memory. See the **Install Pentaho Data Integration and Analytics** document.                                                                                                                                           |
| **Free memory threshold (in %)**                | <p>Specify a percentage number as the threshold. If the sort algorithm has less available free memory than the indicated number, it will begin paging data to disk.This percentage varies per individual production environment because the threshold is re-verified every 1000 rows. The row size, the complexity of the transformation, or other steps in the transformation could still lead to an <code>Out Of Memory Error</code>.</p><p>In a JVM, the exact amount of free memory varies. As a best practice, use this step in less complex transformations that do not require several steps or several processes that are contending for memory.</p> |
| **Compress TMP Files**                          | Select this option to compress any temporary files that are generated to complete the sort. Clear this option to leave temporary files uncompressed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Only pass unique rows? (verifies keys only)** | Select this option to pass only unique rows to the output stream(s). Clear this option to pass all rows to the output stream(s).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Fields table**                                | Specify the fields and direction, ascending or descending, to sort. You can also specify whether to perform a case-sensitive sort. Click the column titles to sort each column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Get Fields**                                  | Click **Get fields** to retrieve a list of all the incoming fields on the stream(s).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/sort-rows-transformation-step/general-sort-rows-step/options-sort-rows-step.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.
