ERPClimb logoERPClimb
ABAP Dictionary: Tables, Buffering and Indexes
ABAP Developmentadvanced 9 min read

ABAP Secondary Indexes on SAP HANA: When to Create One and How to Prove It

Preview · a free account unlocks the full lesson

Key takeaway

Use SQL evidence, predicate selectivity and actual SAP HANA access plans before proposing a secondary index. Walk through index creation in an authorized landscape and validate the cost of reads, writes and maintenance.

In this lessonShow sections

Visual overview

ABAP Secondary Indexes on SAP HANA: When to Create One and How to Prove It — learning sheet1 · Baseline: Identify actual SQL work; Executions / total cost, Rows / selectivity, Existing indexes. 2 · Alternatives: Fix query first; Reduce data volume, Released CDS/API, Avoid repeated reads. 3 · Experiment: Test index only if justified; Representative HANA data, Read + write load, Transport approval. 4 · Decision: Keep only proven gain; Plan + latency, Space/update cost, Rollback criterionERPCLIMB · ABAP DICTIONARYABAP Secondary Indexes on SAP HANA: When to Create One and How to Pr…1 · BaselineIdentify actual SQL workExecutions / total costRows / selectivityExisting indexes2 · AlternativesFix query firstReduce data volumeReleased CDS/APIAvoid repeated reads3 · ExperimentTest index only if justifiedRepresentative HANA dataRead + write loadTransport approval4 · DecisionKeep only proven gainPlan + latencySpace/update costRollback criterionOriginal editorial diagram · Use the lesson text for complete explanations · Verify edition-specific details

Explanation

KEY POINTS

Create an ABAP Dictionary secondary index only after showing that a real, frequent SQL access is expensive, an existing key or index does not serve it well, and the intended index improves the measured workload on the target SAP HANA version. An index is not the default fix for a slow SELECT.

First check what the query actually asks for

A report is slow when it lists all approval requests in a status over a date range. Its table is keyed by CLIENT and REQUEST_ID, but the WHERE clause filters CLIENT, STATUS and CREATED_ON. That mismatch is a reason to investigate, not proof that an index is needed.

The actual predicate may be very unselective—if almost every record is in status 'AP', an index beginning with STATUS may not help. First eliminate SELECT *, unreadable predicates and unbounded result sets where possible. Check that the report really needs every row returned. A pagination or business-filter improvement may save more than a new database structure.


Capture baseline evidence in ST05 or available SQL tracing

Reproduce the transaction with a representative test data distribution, not ten rows in a fresh sandbox. Capture the statement, bound parameters, execution count, elapsed time, rows transferred, database accesses and relevant plan evidence. ST05 is familiar on many on-premise ABAP landscapes; ABAP SQL Monitor and other tracing tools can help establish frequency and aggregate footprint.

Modern cloud editions restrict direct tools, so use the performance instrumentation supported in the actual tenant. Do not claim a specific plan or elapsed time without running it. Distinguish one expensive execution from a cheap query executed 100,000 times.


Understand an index before choosing its columns

An ABAP Dictionary secondary index is an additional database index independent of the primary key. Classical DDIC guidance describes creating the index definition against a table and activating it; index creation may be configured per database system. An index comes with maintenance and memory/storage cost, especially when rows are inserted or updated. On SAP HANA's column store, implicit index structures and columnar processing are already available; techniques that helped older row-store databases do not automatically carry over. Do not append all WHERE columns by habit.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.