> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/local-governance/v2.7/platform/configure-digit/configuring-digit-services/configuring-reports/impact-of-heavy-reports-on-platform.md).

# Impact Of Heavy Reports On Platform

## Overview <a href="#overview" id="overview"></a>

Rainmaker has a reporting framework to configure new reports. As part of the report configuration, we have to write a native SQL query to get the required data for the report. So if the query takes huge time to execute or the query result has huge data, then it will impact the whole application's performance.

## Root Cause <a href="#root-cause" id="root-cause"></a>

The following are cases where we can see the application performance issue because of heavy reports.

* Filtering with long date range data or applying fewer filters which in turn returns huge data
* Join the multiple tables for getting required data and missing creating index on join columns
* Implementing conditional logic inside the queries itself
* Writing multiple sub-queries inside a single query for getting the required data

## Impact <a href="#impact" id="impact"></a>

Because of heavy reporting, the following things impact the platform -

* When we execute a complex query on the database, a thread from the connection pool blocks the query execution.
* When threads from the connection pool are blocked completely, the application becomes very slow for incoming requests
* When the max request timeout is crossed, the API gateway returns a timeout error. But still, the connection thread on the database is active. Then all these types of idle threads occupy the database resources like memory, and the CPU which in turn increases the load on the database.
* Sometimes when running huge queries, the time taken by the query leads to a broken pipe issue which causes more memory leaks and out-of-heap memory type issues. Because of this, the service frequently restarts automatically.
* If a query returns huge data, the browser becomes unresponsive and the application becomes unresponsive.

[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/80x15.png)​](http://creativecommons.org/licenses/by/4.0/)All content on this page by [eGov Foundation](https://egov.org.in/) is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.digit.org/local-governance/v2.7/platform/configure-digit/configuring-digit-services/configuring-reports/impact-of-heavy-reports-on-platform.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
