2008 Jul 16 10:46 AM
Hi All,
Is it possible to create an index on View tabel.
2008 Jul 16 10:49 AM
2008 Jul 16 10:54 AM
I m having a program with select statement, which is trying to retrieve data from view. since all the key field of the view are not used for data retrival, select statement is taking hell lot of time.
Please suggest what to do?
2008 Jul 16 10:56 AM
there are lot of methods for the optimization
paste down your select query
2008 Jul 16 10:57 AM
As I suggested above create index for the table that is taking much time for execution(finout by using ST05) in your view,I used same in my program it is taking less time compare to before index.
2008 Jul 16 10:57 AM
2008 Jul 16 10:57 AM
wait or create an additional index on the tables with the fields you do the select on
within se11 you can create new indexs
and if it's iw37 pleasy fill in the ordertype and werks that helps speeding up the select
Edited by: A. de Smidt on Jul 16, 2008 11:58 AM
Edited by: A. de Smidt on Jul 16, 2008 11:59 AM
2008 Jul 16 10:58 AM
SELECT (g_selfields_tab) FROM viafvc
INTO CORRESPONDING FIELDS OF TABLE ht_viafvc_st
WHERE arbid IN arbid
AND werks IN werks
AND steus IN steus
AND ktsch IN ktsch
AND ltxa1 IN ltxa1
AND istru IN istru
AND anlzu IN anlzu
AND rueck IN rueck
AND fsavd IN fsavd
AND fsavz IN fsavz
AND ssavd IN ssavd
AND ssavz IN ssavz
AND fsedd IN fsedd
AND fsedz IN fsedz
AND isdd IN isdd
AND isdz IN isdz
AND iedd IN iedd
AND iedz IN iedz
2008 Jul 16 11:00 AM
replace that corresponding keword
1>arrange the structure of your internal table similar to the select statement
2>Do you want to retrive all the fields ?if no then specify the name of the fields here.
2008 Jul 16 11:01 AM
SELECT (g_selfields_tab) FROM viafvc
INTO CORRESPONDING FIELDS OF TABLE ht_viafvc_st
WHERE arbid IN arbid
AND werks IN werks
AND steus IN steus
AND ktsch IN ktsch
AND ltxa1 IN ltxa1
AND istru IN istru
AND anlzu IN anlzu
AND rueck IN rueck
AND fsavd IN fsavd
AND fsavz IN fsavz
AND ssavd IN ssavd
AND ssavz IN ssavz
AND fsedd IN fsedd
AND fsedz IN fsedz
AND isdd IN isdd
AND isdz IN isdz
AND iedd IN iedd
AND iedz IN iedz
%_hints oracle 'INDEX("MSEG" "MSEG~ZMS")'.
let MSEG is one of table in your view and ZMS is the index.
try to do index for AFVV or AFVC by checking which one is taking muchtime.
Edited by: SnickyUcan on Jul 16, 2008 12:03 PM
2008 Jul 16 10:52 AM
A database view is not a table. It is effectively a join between tables that is defined in the database rather than locally in your program. You can, of course, create indexes on the tables - though if they are SAP standard tables you should consider carefully whether a new index is really necessary.
2008 Jul 16 10:53 AM
Hi
You can create index only on tables.
and view is not a table. so you cannot create index on views.
With Regards
Nikunj.
2008 Jul 16 10:53 AM
Just goto view
and see if you can find and any tab for view???
i hope you got the answer.
Its not possible.
2008 Jul 16 10:53 AM
Create index for any table that your view table contains,you can use it in your select query.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |