SAP HANA Table Partition Calculator for the 2 Billion Row Limit
A non-partitioned SAP HANA column table, and each partition of a partitioned one, can hold at most 2^31 (about 2.1 billion) rows. This calculator projects a table's growth, shows how many years are left before it hits that limit, and suggests a partition count for your planning horizon.
Your numbers
SUM(RECORD_COUNT) from M_CS_TABLES for the table.
Net of archiving and deletion.
Rule of thumb often used: 100 million to 500 million.
Your results
The per-partition row limit is a HANA system limit. The target rows per partition is a rule of thumb, not an official SAP value; follow SAP's application-specific partitioning guidance for S/4HANA and BW tables.
Recommended partitions vs years ahead
Sweeps Years ahead from 1 to 10, holding your other inputs fixed.
Get a partitioning plan for your largest tables
Send the M_CS_TABLES output for your top 20 tables and we will flag row limit risks and suggest schemes to discuss with SAP guidance.
Optional. The tool and every export work without this. No spam.
How to use it
Get the current row count from M_CS_TABLES: SELECT SCHEMA_NAME, TABLE_NAME, SUM(RECORD_COUNT) AS TOTAL_ROWS, COUNT(*) AS PART_COUNT FROM M_CS_TABLES WHERE TABLE_NAME = 'ACDOCA' GROUP BY SCHEMA_NAME, TABLE_NAME. For a partitioned table each row of M_CS_TABLES is one partition, so also check the largest single PART_ID. Estimate yearly growth from the row count a year ago or from document volumes, net of archiving. Pick a target rows per partition and the number of hosts. The primary output is the partition count that keeps every partition under the target at the horizon; the chart shows how that count rises year by year.
- Check the largest partition, not just the table total
- Include planned data loads and migrations in growth
- For scale-out, round partitions to a multiple of hosts
The limit and the method
The HANA column store has a system limit of 2^31 rows per non-partitioned table or per partition. When an insert would exceed it, the statement fails with an error stating that the maximum number of rows per table or partition has been reached, so a growing table becomes a production outage. Partitioning splits the table into separate column store partitions, each with its own limit. SAP's partitioning FAQ (SAP Note 2044468) discusses sizing and commonly cited ranges of a few hundred million rows per partition; the 500 million default here is a planning rule, not a hard rule. Too many tiny partitions hurt queries that cannot prune partitions, so do not over-partition.
- HASH: even spread on a key column, good when no natural range exists
- RANGE: by year or period, enables pruning and simple ageing
- HASH-RANGE: multi-level, hash first then range within it
Worked example and SQL
A table with 1.2 billion rows grows 300 million a year. With one partition it hits 2^31 in about 3.2 years. Over 5 years it reaches 2.7 billion rows, so with a 500 million target you need 6 partitions of about 450 million rows each. In SQL a hash repartition looks like ALTER TABLE "SAPABAP1"."ZSALES_HIST" PARTITION BY HASH ("DOCNR") PARTITIONS 6; and a range by year like PARTITION BY RANGE ("GJAHR") (PARTITION '2020' <= VALUES < '2025', PARTITION OTHERS). Repartitioning rewrites the table, needs memory for both copies and generates heavy redo, so run it in a window and check log backup capacity first.
SAP application tables
Large S/4HANA tables such as ACDOCA (Universal Journal), MATDOC (material documents) and BALDAT (application log data) are frequent candidates. For S/4HANA and BW, do not invent a scheme with plain SQL: follow the SAP Notes for the application, and in BW use the BW-specific partitioning tools, because the application layer may expect specific partitioning columns. For BALDAT, deleting old application logs (SLG2) is often better than partitioning. Recheck M_CS_TABLES after any repartition and confirm partitions are spread across hosts in M_TABLE_PARTITIONS or M_CS_TABLES HOST column.
Frequently Asked Questions
What is the SAP HANA table size limit?
For column store tables the row limit is 2^31 rows per table if not partitioned, or per partition if partitioned. There is no practical byte limit beyond memory and disk, but a large table must fit in memory when loaded, so memory is usually the first constraint.
How do I check table size in SAP HANA?
Query M_CS_TABLES for RECORD_COUNT, MEMORY_SIZE_IN_TOTAL and ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL by SCHEMA_NAME and TABLE_NAME, summing over partitions. M_TABLE_PERSISTENCE_STATISTICS shows disk size. In ABAP systems DBACOCKPIT also lists table sizes.
Is table partitioning a Basis task?
Usually yes for technical repartitioning, but the partitioning column and scheme should be agreed with the application owners, because it affects query pruning and, for S/4HANA and BW, must follow SAP guidance. Basis runs it in a maintenance window with memory and log headroom checked.
Can I add partitions later without downtime?
Repartitioning is an online operation in recent revisions for many cases, but it is resource intensive and locks can affect writers. Plan it like a maintenance task, test on a copy, and do not wait until a table is weeks from the 2^31 limit.
If you want your team to ask which HANA tables are approaching their row limits, in plain English on your own servers, we can build that over your monitoring views.
Related Tools
SAP HANA Largest Tables SQL Query Generator
Generates SAP HANA SQL for the biggest tables and the usual archiving suspects, to size and reduce data before migration.
SAPSAP HANA Disk Sizing Calculator (/hana/data, /hana/log, /hana/shared)
Work out the size of the HANA data, log and shared file systems from host RAM, net data size and growth, using the formulas in SAP's storage requirements white paper.
SAPSAP HANA Global Allocation Limit Calculator
Calculate the default HANA 2.0 memory allocation limit for your RAM, the MB value to set when reserving memory, tenant limits and statement memory exposure.
SAPSAP HANA Log Volume Full Time Calculator (Log Backup Outage)
See how long the HANA log volume lasts if log backups fail, and how full it will be after an outage of a given length.
More SAP tools
See all- SAP HANA Monitoring Views Reference (M_ System Views)
- SAP HANA SQL Error Codes Reference
- SAP HANA Memory Usage SQL Generator (Used, Resident, Heap)
- SAP HANA Table Load, Unload and Preload SQL Generator
- SAP HANA Backup SQL Statement Generator (Data, Delta, Catalog)
- SAP HANA Backup Storage and Retention Calculator
- SAP HANA Revision and SPS Upgrade Checklist (hdblcm)
- SAP HANA Performance Health Checklist (Memory, CPU, Locks, Merges)
- SAP Movement Types Reference
Keep exploring
Free tools
- SAP HANA Global Allocation Limit CalculatorCalculate the default HANA 2.0 memory allocation limit for your RAM, the MB value to set when reserving memory, tenant limits and statement memory exposure.
- SAP HANA Monitoring Views Reference (M_ System Views)One row per SAP HANA monitoring view with the key columns to select and the question it answers: memory, table size, disk, backups, locks, sessions and SQL.
- SAP HANA SQL Error Codes ReferenceSearchable table of common SAP HANA 2.0 SQL error codes with the error text, typical cause, the view or trace to check first and the fix.
ERP fixes and how-tos
- Private AI for SAP Business One: Service Layer, a read replica and a local modelAdd a private AI assistant to SAP Business One: Service Layer reads, SQL Server or HANA replica, document index, local LLM, permissions and approvals.
- SAP S/4HANA API Guide: Business Hub, OData, Public Cloud and Business PartnerA guide to SAP S/4HANA APIs: the Business Accelerator Hub, A2X OData, the Business Partner API, public cloud communication arrangements, PI/PO and Digital Manufacturing.
- SAP S/4HANA API Documentation: Where It Is and How to Use ItWhere to find S/4HANA API documentation (SAP Business Accelerator Hub), OData vs SOAP, authentication on cloud and on-prem, and key manufacturing APIs.
Integrations
- How to connect Power BI to SAP Business OneConnect Power BI to SAP Business One: SQL Server or HANA direct, Service Layer OData, gateway setup, key manufacturing dashboards and natural-language Q&A.
- How to connect Power BI to SAP S/4HANAConnect Power BI to SAP S/4HANA using the HANA connector, OData or a warehouse, set up the on-prem gateway, and build manufacturing dashboards with AI Q&A.