> For the complete documentation index, see [llms.txt](https://docs.pinot.apache.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinot.apache.org/operate-pinot/tuning/performance-optimization-configurations.md).

# Performance Optimization Configurations

#### Query Option to Enable \`AND\` Predicate Reordering

An optional optimization for queries with long `AND` predicate will be to let execution engine reorder the predicates based on cardinality, so as to do minimum scanning for un-indexed operators. To use it, simply add the following option to the original query

```
SET AndScanReordering = 'True'; SELECT FOO from BAR WHERE predicate1 AND predicate2 AND predicate3 AND predicate4 ...
```

This feature cannot guarantee optimization for all use cases, but on average it can help. Try with some before/after comparison.

PR: <https://github.com/apache/pinot/pull/9420>

#### Enabling Server Side Segment Stream Download-Untar with rate limiter:

Pinot server supports segment download-untar with rate limiter, which reduces the bytes written to disk and optimizes disk bandwidth usage <https://github.com/apache/pinot/pull/8753>. This feature supports both HTTP-based segment fetchers and all PinotFS implementations (S3, GCS, ADLS Gen2, etc.), allowing segments to stream directly from your configured storage backend. This feature involves the following server level configs

```
pinot.server.instance.segment.stream.download.untar : true
// enable stream download and untar (works with HTTP and all PinotFS backends) 
pinot.server.instance.segment.stream.download.untar.rate.limit.bytes.per.sec : 100000000
// the max download-untar rate is limited to 100000000 bytes/sec
```

Another useful config is:

```
pinot.server.instance.table.level.max.parallel.segment.downloads : 4
```

This helps to limit the number of max parallel number of segment download per table, at server level

#### Enabling Netty Native TLS:

Apache Pinot supports using native TLS library <https://netty.io/wiki/forked-tomcat-native.html> for broker-server transmission, which would potentially boost TLS encryption/decryption performance. This can be enabled by adding the following broker/server config

```
pinot.broker.tls.ssl.provider :  OPENSSL
pinot.server.tls.ssl.provider :  OPENSSL
```

#### Enabling Netty Native Transport:

Apache Pinot supports using native transport library <https://netty.io/wiki/native-transports.html> for broker-server transmission, which would potentially boost performance under high QPS. This can be enabled using:

```
pinot.broker.netty.native.transports.enabled : true
pinot.server.netty.native.transports.enabled : true
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pinot.apache.org/operate-pinot/tuning/performance-optimization-configurations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
