Quick Note on Design of secondary database indexes and logical databases

Secondary Database

First it must be stated that table design is a more logical work while index design is rather technical. In table design it might make sense to place certain fields (client, company code, ...) in the beginning. In index design, this is not advisable.  Very important for an index is that it contains very selective fields in the beginning. Those are fields like object numbers. Not selective are client, company code, ... 

Indexes should be small (few fields).  The Database optimizer can combine two or more indexes to execute a query. 

Indexes of one table should be disjoint (have few common fields), in order not to confuse the optimizer which index to use. 

Note that each index slows the inserts into the table down. Updates are only slowed down if indexed fields are updated. In general, heavy inserted tables should have only few indexes while heavy selected tables might have more. 

Logical Database

Using logical databases is a good method to write reports. Logical databases can be optimized centrally. But ensure that the structure of the logical database fits well to your report. Otherwise the effect can be the opposite. 

Please clarify my doubts:
1. What is meant by secondary index?
2. What is the purpose of cursor?

Srinvias

If you cannot use the primary index to determine the result set because, for example, none of the fields primary index occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set. 

You should only create secondary indexes, for database tables from which you mainly read, since indexes have to be updated each time the database table is changed.  secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible to improve performance..

Cursor is used to read the data:-----

When you use a cursor to read data, you decouple the process from the SELECT statement. To do this, you must open a cursor for a SELECT statement. Afterwards, you can place the lines from the selection into a flat target area. An open cursor points to an internal handler, similarly to a reference variable pointing to an object.

Cursor is used for one more purpose that is ,You can set the cursor on the current list dynamically from within your program. You can do this to support the user with entering values into input fields or selecting fields or lines. To set the cursor we use SET CURSOR command.

SET cursor <col> <lin>. 

This statement sets the cursor to column <col> of line <lin> of the output window.

Rashi

Fast Links:
Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.