> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/introduction/performance-optimization-tips.md).

# Performance optimization tips

Evaluating the performance of your API queries helps ensure optimal functionality, especially when working with large datasets or complex operations. While queries may appear efficient in smaller test environments, their behavior can differ significantly under production-like conditions, potentially leading to performance challenges. Inefficient queries, sorting strategies, or user permissions can lead to performance degradation in production environments. Comprehensive testing helps you identify and address these issues before deployment.

## Disable count queries

When using `TableViewConfig` queries, the response includes both the actual data and the total number of rows matching your filter criteria. Calculating this total count requires a separate database request that is often slower than the data retrieval query itself.

To improve query response time, disable the count query by setting `maxCountLimit` to 0:

```json
{  
    "TableViewConfig": {  
        "maxCountLimit": 0,  
        ...  
    }  
}
```

## Use asynchronous exports instead of offset pagination

When exporting large datasets, the response size can exceed practical limits. While offset-based pagination allows you to retrieve data in chunks, performance degrades significantly as you move through pages, with each subsequent query becoming slower.

The recommended approach is to let the Output Module handle pagination automatically by submitting a single query to an asynchronous endpoint:

{% stepper %}
{% step %}
Submit your query without `displayLength` to an asynchronous endpoint.
{% endstep %}

{% step %}
Wait for the export job to complete.
{% endstep %}

{% step %}
Download the generated export file.
{% endstep %}
{% endstepper %}

This method is far more efficient than manually paginating through multiple pages.

## Optimize sorting strategy

Sorting assets by attributes or by related asset properties such as name or attributes is computationally expensive from a database perspective.

Some best practices for sorting are:

* Sort by the asset `Id`, `fullName`, or `displayName` when possible.
* Avoid sorting altogether if it's not essential to your use case.

These simpler sorting approaches significantly reduce database load and improve query performance.

## Use accounts with VIEW\_ALL permission

When calling the Output Module using a regular user account, the results are filtered based on the view permissions of that user account. This filtering adds significant overhead to the database query, negatively impacting performance.

For automated exports, use an account that has `VIEW_ALL` permission. This eliminates the need for user permission logic in the database query, resulting in faster query execution and improved overall performance.


---

# 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://developer.collibra.com/api/guides/introduction/performance-optimization-tips.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.
