Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kbhasin04
New Member

Memory allocation error, Issue with Loading Data from PostgreSQL via ODBC Connector in Power BI

I am encountering an issue while loading data from PostgreSQL using the ODBC connector in Power bi desktop. The error message i receiveis"

 

"DataSource.Error: ODBC: ERROR [HY001] Out of memory while reading tuples.;
memory allocation error???
Details:
DataSourceKind=Odbc
DataSourcePath=dsn=gtn-db
OdbcErrors=[Table]

 

Does anyone know what might be causing this error?

Any advice you can offer would be most appreciated.

1 ACCEPTED SOLUTION
data_msfabric
Frequent Visitor

The error message you're seeing:

"ODBC: ERROR [HY001] Out of memory while reading tuples"

means that Power BI (or the underlying ODBC driver) is running out of memory when trying to retrieve a large amount of data from PostgreSQL via ODBC.

Root Cause

This typically happens due to one or more of the following:

  1. Large volume of data being fetched in a single query (millions of rows or wide tables).

  2. Insufficient memory on your machine (Power BI Desktop is memory-intensive).

  3. ODBC driver limitations in terms of memory buffer allocation.

  4. Power BI default settings causing Power Query to load entire data into memory for transformations.

  5. No query folding – transformations applied in Power BI are not pushed to PostgreSQL, causing massive memory usage locally.

Recommended Solutions

1. Use Native PostgreSQL Connector (Not ODBC)

  • Instead of ODBC, use PostgreSQL native connector in Power BI:

    • Home → Get Data → Database → PostgreSQL

    • Ensure Npgsql PostgreSQL driver is installed: Npgsql download

This is more efficient and supports query folding, reducing memory usage.

2. Filter or Reduce Data Before Loading

  • In Power Query, apply filters on:

    • Date columns (e.g., last 6 months)

    • ID ranges, top N rows, or where conditions

  • Always preview a smaller subset before importing the full data.

3. Use SQL Queries Instead of Full Table Loads

  • Go to Power Query → Advanced Editor → Use a custom SQL query:

SELECT column1, column2 
FROM your_table
WHERE created_at >= CURRENT_DATE - INTERVAL '6 months'
  • This reduces the amount of data fetched at source level.

4.  Increase System & Driver Memory (Advanced)

If you're stuck with ODBC:

  • Try increasing ODBC driver's memory buffer in ODBC settings.

  • On 64-bit Power BI, ensure you’re using 64-bit ODBC driver.

  • Close other memory-intensive apps.

5.  Enable Query Folding

  • Avoid transformations in Power BI that break query folding (like adding index columns, merging, etc.).

  • Right-click steps in Power Query and check if “View Native Query” is available. If not, try simplifying steps.

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Kbhasin04,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,

Vinay Pabbu

Anonymous
Not applicable

Hi @Kbhasin04,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,

Vinay Pabbu

Anonymous
Not applicable

Hi @Kbhasin04,

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,

Vinay Pabbu

data_msfabric
Frequent Visitor

The error message you're seeing:

"ODBC: ERROR [HY001] Out of memory while reading tuples"

means that Power BI (or the underlying ODBC driver) is running out of memory when trying to retrieve a large amount of data from PostgreSQL via ODBC.

Root Cause

This typically happens due to one or more of the following:

  1. Large volume of data being fetched in a single query (millions of rows or wide tables).

  2. Insufficient memory on your machine (Power BI Desktop is memory-intensive).

  3. ODBC driver limitations in terms of memory buffer allocation.

  4. Power BI default settings causing Power Query to load entire data into memory for transformations.

  5. No query folding – transformations applied in Power BI are not pushed to PostgreSQL, causing massive memory usage locally.

Recommended Solutions

1. Use Native PostgreSQL Connector (Not ODBC)

  • Instead of ODBC, use PostgreSQL native connector in Power BI:

    • Home → Get Data → Database → PostgreSQL

    • Ensure Npgsql PostgreSQL driver is installed: Npgsql download

This is more efficient and supports query folding, reducing memory usage.

2. Filter or Reduce Data Before Loading

  • In Power Query, apply filters on:

    • Date columns (e.g., last 6 months)

    • ID ranges, top N rows, or where conditions

  • Always preview a smaller subset before importing the full data.

3. Use SQL Queries Instead of Full Table Loads

  • Go to Power Query → Advanced Editor → Use a custom SQL query:

SELECT column1, column2 
FROM your_table
WHERE created_at >= CURRENT_DATE - INTERVAL '6 months'
  • This reduces the amount of data fetched at source level.

4.  Increase System & Driver Memory (Advanced)

If you're stuck with ODBC:

  • Try increasing ODBC driver's memory buffer in ODBC settings.

  • On 64-bit Power BI, ensure you’re using 64-bit ODBC driver.

  • Close other memory-intensive apps.

5.  Enable Query Folding

  • Avoid transformations in Power BI that break query folding (like adding index columns, merging, etc.).

  • Right-click steps in Power Query and check if “View Native Query” is available. If not, try simplifying steps.

 

Akash_Varuna
Super User
Super User

Hi @Kbhasin04 This error can occur due to large data volumes or insufficient memory. Try limiting the data using filters, optimizing PostgreSQL queries, and increasing virtual memory. Switching to DirectQuery mode can also help avoid loading all data into memory.

Hi @Akash_Varuna , thanks for your response. I have tried these steps but still same issue presists. Also tried to add parameter and to load only 1000 records but its not allowing that thing aswell. 

@Kbhasin04 Could you try updating your PostgreSQL ODBC driver and ensure Power BI Desktop is also up-to-date? If possible try , switching from the ODBC connector to Power BI’s native PostgreSQL connector might help. Also, please check if your queries are optimized and indexed for better performance.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.