SlideShare a Scribd company logo
2
Most read
5
Most read
6
Most read
OVERVIEW OF
INDEX
Kabilarasan RPresented by
INDEX
 Purpose: Index makes the database table search faster.
 A database index is a data structure that improves the speed of data retrieval operations on a
database table
 Indexes are used to quickly locate data without having to search every row in a database table
How it Works?
 This index table contains a field which contains the pointer to the actual record in the table.
 Indexes can be created using one or more columns of a database table
Types of Index
Primary Index
 Primary index contains all the key fields of the table and a pointer to the non-key
fields.
 It is automatically created at the time of creation of table.
 Primary index is a unique index
Example
MAND
T
CARRID COUNT_NU
M
P
001 AA 001 7
001 BA 001 9
001 BA 002 12
001 BA 003 5
001 BA 004 2
001 LH 001 10
001 LH 002 4
001 LH 003 8
001 LH 004 11
001 LH 005 1
001 LH 006 13
001 LH 007 6
001 UA 001 3
001 UA 008 14
MANDT CARRID COUNT_NU
M
AIRPOR
T
001 LH 005 ACA
001 BA 004 ACE
001 UA 001 BER
001 LH 002 LCY
001 BA 003 LHR
001 LH 007 BER
001 AA 001 DEN
001 LH 003 FRA
001 BA 001 LCY
001 LH 001 LGW
001 LH 004 LHR
001 BA 002 MUD
001 LH 006 RTM
001 UA 008 HAM
Primary Index
for
SCOUNTER
Table:
SCOUNTER
 It demonstrates how the primary
index table will look like.
 The pointer refers to position where
the same record in the sorted primary
table is available in the actual
database table which you can see
with the highlighted Red line.
Key Fields
Secondary Index
 We can also add our own index to the table known as secondary index. We create
secondary index for the non-key fields.
 The secondary indexes are only to be created when these fields are used
extensively in search.
MANDT CARRID COUNT_NUM AIRPORT
001 LH 005 ACA
001 BA 004 ACE
001 UA 001 BER
001 LH 002 LCY
001 BA 003 LHR
001 LH 007 BER
001 AA 001 DEN
001 LH 003 FRA
001 BA 001 LCY
001 LH 001 LGW
001 LH 004 LHR
001 BA 002 MUD
001 LH 006 RTM
001 UA 008 HAM
 From this table (SCOUNTER) consider a
scenario where I wanted to fetch the
record from the database table based on
the airport code (AIRPORT) which is
actually a non-key field.
 Sorting of the primary keys will not be of
any use as the airport code will still be
scattered.
 A secondary index for the field airport code
needs to be created to support the faster
access.
Table: SCOUNTER
Example
MANDT CARRID COUNT_NU
M
AIRPOR
T
001 LH 005 ACA
001 BA 004 ACE
001 UA 001 BER
001 LH 002 LCY
001 BA 003 LHR
001 LH 007 BER
001 AA 001 DEN
001 LH 003 FRA
001 BA 001 LCY
001 LH 001 LGW
001 LH 004 LHR
001 BA 002 MUD
001 LH 006 RTM
001 UA 008 HAM
Secondary
Index on
AIRPORT
Table:
SCOUNTER
 Now when I select the records using
the AIRPORT (airport code), then the
system will identify the list of records
for the airport code in the index table.
 And fetch the corresponding records
using the pointer which you can see
through the highlighted colour red for
the airport search LCY.
AIRPORT P
ACA 1
ACE 2
BER 3
BER 6
DEN 7
FRA 8
HAM 14
LCY 4
LCY 9
LGW 10
LHR 6
LHR 11
MUD 12
RTM 13
SELECT * FROM
SCOUNTER
WHERE AIRPORT = ā€˜LCY’
Options
 Unique Index: If the fields chosen in an index are very unique i.e., for each
combination of fields only one entry exists, then we chose unique index.
 Non-Unique Index: If the above is not true, we choose this option. We have 3 radio
buttons under this called Index on all database systems, For selected database
systems, and No database index. We can chose any one of them depending on our
requirement.
 For client Dependent tables, we always include the field ā€œMANDTā€ under all the
indexes or else, Optimizer might not use the Index.
Tables that allow Indexing
 Not all the tables allow you to create an Index.
 They are allowed only for transparent tables. All business data and application data
are stored in transparent tables.
 Ex: VBPA (Sales Document: Partner), VLCVEHICLE (VELO: Vehicle), MARA
(General Material Data), etc..
 Secondary indexes are not allowed for the below tables but gives a message saying
ā€˜Index maintenance only possible for transparent tables’.
 Cluster tables:
Ex: BSEG (Accounting Document Segment), KONV Conditions (Transaction
Data) ), etc…
 Pooled tables:
Ex: Configuration tables, etc..
Index in SAP ABAP

More Related Content

PPTX
Sap abap
PDF
SAP ABAP data dictionary
DOCX
Field symbols
PPTX
CDS Views.pptx
PPT
Chapter 02 sap script forms
PPTX
Abap data dictionary
PPT
Module pool programming
PPTX
Reports
Sap abap
SAP ABAP data dictionary
Field symbols
CDS Views.pptx
Chapter 02 sap script forms
Abap data dictionary
Module pool programming
Reports

What's hot (20)

PDF
Using idoc method in lsmw
PPTX
SAP Modularization techniques
PDF
Technical Overview of CDS View – SAP HANA Part I
PPTX
Summarisation levels in SAP COPA
DOCX
Sap abap modularization interview questions
PPT
Alv theory
PPTX
Oops abap fundamental
PPT
Introduction to ABAP
PDF
Using infoset query %2c sap query and quick viewer
PDF
Table maintenance generator and its modifications
PPT
ABAP Programming Overview
PDF
Abap reports
PDF
How to add new Object Link in SAP DMS
PDF
Smartforms interview questions with answers
PDF
Technical Overview of CDS View - SAP HANA Part II
PDF
Sap Abap Reports
Ā 
PDF
ABAP for Beginners - www.sapdocs.info
PPT
SAP ABAP - Needed Notes
PPT
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
PPT
0104 abap dictionary
Using idoc method in lsmw
SAP Modularization techniques
Technical Overview of CDS View – SAP HANA Part I
Summarisation levels in SAP COPA
Sap abap modularization interview questions
Alv theory
Oops abap fundamental
Introduction to ABAP
Using infoset query %2c sap query and quick viewer
Table maintenance generator and its modifications
ABAP Programming Overview
Abap reports
How to add new Object Link in SAP DMS
Smartforms interview questions with answers
Technical Overview of CDS View - SAP HANA Part II
Sap Abap Reports
Ā 
ABAP for Beginners - www.sapdocs.info
SAP ABAP - Needed Notes
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
0104 abap dictionary
Ad

Similar to Index in SAP ABAP (20)

PPT
Indexing
PDF
MySQL INDEXES
PDF
Db lec 08_new
PPTX
DB LECTURE 4 INDEXINGS PPT NOTES.pptx
PDF
MySQL Query And Index Tuning
PPTX
Database_Indexing_AND ITTS TYPES PRESENTATION
PDF
Advanced MySQL Query Optimizations
PDF
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
PPTX
Indexing
PPTX
Optimizing MySQL Queries
PDF
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
PPTX
MySQL Indexes
PPTX
Database Management System-Module-IV(part-1).pptx
PDF
Explain2
PPTX
Lecture 17 (Week 11) - MYSQL INDEXES.pptx
PDF
MySQL: Indexing for Better Performance
PPT
Intro to Data warehousing lecture 11
PPT
Intro to Data warehousing lecture 14
PPT
Intro to Data warehousing lecture 19
PDF
MySQL Indexing
Ā 
Indexing
MySQL INDEXES
Db lec 08_new
DB LECTURE 4 INDEXINGS PPT NOTES.pptx
MySQL Query And Index Tuning
Database_Indexing_AND ITTS TYPES PRESENTATION
Advanced MySQL Query Optimizations
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
Indexing
Optimizing MySQL Queries
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexes
Database Management System-Module-IV(part-1).pptx
Explain2
Lecture 17 (Week 11) - MYSQL INDEXES.pptx
MySQL: Indexing for Better Performance
Intro to Data warehousing lecture 11
Intro to Data warehousing lecture 14
Intro to Data warehousing lecture 19
MySQL Indexing
Ā 
Ad

Recently uploaded (20)

PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
1_Introduction to advance data techniques.pptx
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
IB Computer Science - Internal Assessment.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Introduction to machine learning and Linear Models
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
Computer network topology notes for revision
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Clinical guidelines as a resource for EBP(1).pdf
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
ISS -ESG Data flows What is ESG and HowHow
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
1_Introduction to advance data techniques.pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx
IB Computer Science - Internal Assessment.pptx
Reliability_Chapter_ presentation 1221.5784
Fluorescence-microscope_Botany_detailed content
Introduction to machine learning and Linear Models
Business Acumen Training GuidePresentation.pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Computer network topology notes for revision
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx

Index in SAP ABAP

  • 2. INDEX  Purpose: Index makes the database table search faster.  A database index is a data structure that improves the speed of data retrieval operations on a database table  Indexes are used to quickly locate data without having to search every row in a database table How it Works?  This index table contains a field which contains the pointer to the actual record in the table.  Indexes can be created using one or more columns of a database table
  • 4. Primary Index  Primary index contains all the key fields of the table and a pointer to the non-key fields.  It is automatically created at the time of creation of table.  Primary index is a unique index
  • 5. Example MAND T CARRID COUNT_NU M P 001 AA 001 7 001 BA 001 9 001 BA 002 12 001 BA 003 5 001 BA 004 2 001 LH 001 10 001 LH 002 4 001 LH 003 8 001 LH 004 11 001 LH 005 1 001 LH 006 13 001 LH 007 6 001 UA 001 3 001 UA 008 14 MANDT CARRID COUNT_NU M AIRPOR T 001 LH 005 ACA 001 BA 004 ACE 001 UA 001 BER 001 LH 002 LCY 001 BA 003 LHR 001 LH 007 BER 001 AA 001 DEN 001 LH 003 FRA 001 BA 001 LCY 001 LH 001 LGW 001 LH 004 LHR 001 BA 002 MUD 001 LH 006 RTM 001 UA 008 HAM Primary Index for SCOUNTER Table: SCOUNTER  It demonstrates how the primary index table will look like.  The pointer refers to position where the same record in the sorted primary table is available in the actual database table which you can see with the highlighted Red line. Key Fields
  • 6. Secondary Index  We can also add our own index to the table known as secondary index. We create secondary index for the non-key fields.  The secondary indexes are only to be created when these fields are used extensively in search.
  • 7. MANDT CARRID COUNT_NUM AIRPORT 001 LH 005 ACA 001 BA 004 ACE 001 UA 001 BER 001 LH 002 LCY 001 BA 003 LHR 001 LH 007 BER 001 AA 001 DEN 001 LH 003 FRA 001 BA 001 LCY 001 LH 001 LGW 001 LH 004 LHR 001 BA 002 MUD 001 LH 006 RTM 001 UA 008 HAM  From this table (SCOUNTER) consider a scenario where I wanted to fetch the record from the database table based on the airport code (AIRPORT) which is actually a non-key field.  Sorting of the primary keys will not be of any use as the airport code will still be scattered.  A secondary index for the field airport code needs to be created to support the faster access. Table: SCOUNTER
  • 8. Example MANDT CARRID COUNT_NU M AIRPOR T 001 LH 005 ACA 001 BA 004 ACE 001 UA 001 BER 001 LH 002 LCY 001 BA 003 LHR 001 LH 007 BER 001 AA 001 DEN 001 LH 003 FRA 001 BA 001 LCY 001 LH 001 LGW 001 LH 004 LHR 001 BA 002 MUD 001 LH 006 RTM 001 UA 008 HAM Secondary Index on AIRPORT Table: SCOUNTER  Now when I select the records using the AIRPORT (airport code), then the system will identify the list of records for the airport code in the index table.  And fetch the corresponding records using the pointer which you can see through the highlighted colour red for the airport search LCY. AIRPORT P ACA 1 ACE 2 BER 3 BER 6 DEN 7 FRA 8 HAM 14 LCY 4 LCY 9 LGW 10 LHR 6 LHR 11 MUD 12 RTM 13 SELECT * FROM SCOUNTER WHERE AIRPORT = ā€˜LCY’
  • 9. Options  Unique Index: If the fields chosen in an index are very unique i.e., for each combination of fields only one entry exists, then we chose unique index.  Non-Unique Index: If the above is not true, we choose this option. We have 3 radio buttons under this called Index on all database systems, For selected database systems, and No database index. We can chose any one of them depending on our requirement.  For client Dependent tables, we always include the field ā€œMANDTā€ under all the indexes or else, Optimizer might not use the Index.
  • 10. Tables that allow Indexing  Not all the tables allow you to create an Index.  They are allowed only for transparent tables. All business data and application data are stored in transparent tables.  Ex: VBPA (Sales Document: Partner), VLCVEHICLE (VELO: Vehicle), MARA (General Material Data), etc..
  • 11.  Secondary indexes are not allowed for the below tables but gives a message saying ā€˜Index maintenance only possible for transparent tables’.  Cluster tables: Ex: BSEG (Accounting Document Segment), KONV Conditions (Transaction Data) ), etc…  Pooled tables: Ex: Configuration tables, etc..

Editor's Notes

  • #3: 1. A data structure is a specialized format for organizing and storing data 2. A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and storage space to maintain the index data structure. 3. Data structure: B- trees are the most commonly used Reason: 1.bcoz its time efficient. i.e., lookups, insertion, deletion are done in logarithmic time 2. data that is stored inside the B- tree can beĀ sorted. either asc or desc (default asc).
  • #5: Primary index is a unique index constructed from the key fields of the primary key.
  • #9: The airport ID is used to search for counters for such an access. Sorting the primary index is of no use in speeding up this access. Since table SCOUNTER has a large number of entries, a secondary index on the field AIRPORT (ID of the airport) must be created to support access using the airport ID.