on 07-30-2007 1:14 PM
Hi,
If i am creating secodary index on DSO..There r two types Unique and Non-unique index..
What is the difference between these two index.Explain with one example.
While creating index naming is coming like 010,020,030..like this ..Is there any purpose for this naming convention.
Also In my DSO
Keyfield-F1
Datafield-S1,S2,S3,S4
So primary index is automatically created for F1,but if i generated a query based on S1..How will be the query performance
If i am creating secondary index based on S1 and generating query..How will be the performance..
How to check performance difference between these two queries (i.e with and without secondary index on S1)..
Regards
Prakash
Unique index - there can only be on row in the table with this value. Usually this is reserved for the Primary index which usually includes teh document number.
Non-unique - you can have multiple rows with tha same values. This is what a DSO secondary index would normally have.
I wouldn't worry about the naming convention of the index. The name used doesn't have any impact on your query. The DB figures out which index to use in the BW environment.
As to how much it will help the query, that depends on how selective S1 is. If you run a query requesting one specific S1 value from a 1,000,000 row table with only 50 rows having that value, your performance should be very good. If there are 5,000 rows with that value, it obviously will take longer. If you have 100,000, the DB probably won't (and shouldn't) use the S1 index at full, instead opting to scan the entire table.
Another option to get a sense of what kind of performance to expect would be to run the query from RSRT <b>before</b> you create the index using the Exec 7 Debug option with the selection <b>Display Run Schedule</b>. This will display what is known as the Explain or Execution Plan and will provide a query "cost". Then run the query again <b>after</b> you have created the index. Compare teh cost. The Explain Plan should also show that the index was used.
It will probably be necessary to refresh the DB statistics on the DSO after you create the index before you run the query.
Your DBA can explain what the Explain Plan is showing.
If you are ging to create secondary indexes on large DSOs, you should keep your DBA in the llop. They can offer guidance on the appropriate index construction, and they may also need to make sure enough dispace is allocated for the new indexes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi prakash,
I guess the indices 10, 20 and 30 are already existing for the table. When you click on indices it pops up another screen displaying the available indices on the table. When you click on Create button in this screen, it will ask you for the index name and then you can define the index...
To check if the Indices 10, 20 or 30 is active in the database, you have to choose the index and you will find a Line below the Status of the index "Index /BIC/AYGTGD2010002 exists in database system" this indicates that the index is active in the database.
Regards,
Praveen.
If you have create indexes 010, 020, and 030 for the DSO, then 3 secondary indexes will be built when you activate the ODS. Keep in mind, this can take some time if you are working witha large DSO, so you may want to transport one index and see how long that takes for the activation to complete rather thna doing multiple indexes at the same time. Also check to make sure you have adequate freespace in the tablespace the indexes will be built in before you transport.
Hi Prakash,
This link details Indexes Primary/Secondary and Unique Indexes.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm
Query performance will improve with the secondary index on the ods.
Use Transaction ST05 to check how much of an improvement with/without the secondary index. You might need to Activate the trace and get the right SQL statement for each of the case.
Use Explain SQL statement option to check if its using the right index and its performance.
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.