---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/troubleshooting/errors/ERR-DS_API-DB-MEMORY_LIMIT_EXCEEDED
  - ru/troubleshooting/errors/ERR-DS_API-DB-MEMORY_LIMIT_EXCEEDED
  - href: en/troubleshooting/errors/ERR-DS_API-DB-MEMORY_LIMIT_EXCEEDED.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/troubleshooting/errors/ERR-DS_API-DB-MEMORY_LIMIT_EXCEEDED.html
title: DataLens On-premises error ERR.DS_API.DB.MEMORY_LIMIT_EXCEEDED
description: >-
  This page describes the Memory limit has been exceeded during query execution
  DataLens On-premises error.
vcsPath: en/troubleshooting/errors/ERR-DS_API-DB-MEMORY_LIMIT_EXCEEDED.md
---

# [DataLens On-premises] Memory limit has been exceeded during query execution

`ERR.DS_API.DB.MEMORY_LIMIT_EXCEEDED`

There is not enough memory in the data source to run the query.

The error occurs when the database does not have enough memory to run a query from DataLens.



To correct the error, optimize the source table or reduce the amount of data in the query using chart filters.

To optimize tables, contact your database administrator.

If you are going to perform optimization yourself, try enhancing your database with indexes and sorts.

{% note tip %}

If ClickHouse® is your data source, find queries from DataLens in [system.query_log](https://clickhouse.com/docs/enen/operations/system-tables/query_log).


If PostgreSQL MDB is your data source, review the performance analysis.


{% endnote %}


<!-- source: en/_includes/clickhouse-disclaimer.md -->
_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._
<!-- endsource: en/_includes/clickhouse-disclaimer.md -->
