I have a problem with the speed of views:

select stueli_pos.pos_nr, stueli_pos.stueli_nr, stueli_pos.teil_nr, teil.kurzname, 
teil.typ, 
stueli_pos.me, mg.mg_nr, mg.bez, mm_1.mm_nr, mm_2.mm_nr, mm_3.mm_nr, mm_1.bez, 
mm_2.bez, mm_3.bez, stueli_pos.text_1,
stueli_kopf.typ as stueli_typ,
stueli_kopf.text_1 as stueli_text,
teil_ref.teil_nr as stueli_teilnr
from stueli_pos, teil, mg, mm mm_1, mm mm_2, mm mm_3, stueli_kopf, teil teil_ref
where teil.teil_nr = stueli_pos.teil_nr and
mg.mg_nr (+) = stueli_pos.mg_nr and
mm_1.mm_nr (+) = stueli_pos.mm_1 and
mm_2.mm_nr (+) = stueli_pos.mm_2 and
mm_3.mm_nr (+) = stueli_pos.mm_3 and
(stueli_kopf.stueli_nr = stueli_pos.stueli_nr) and
(teil_ref.stueli_nr (+) = stueli_kopf.stueli_nr and teil_ref.stueli_nr is not null)
and stueli_kopf.stueli_nr = 452

The execution time for this query is 0.068 sec (43 rows).

If I create a view with this select statement (without "and stueli_kopf.stueli_nr = 
452") and then execute:

select * from qry_stueli_print where stueli_nr = 452

it took 12.6 sec to execute, which is exactly the exec time for the view called 
without any where clause (112608 rows).

Is there a way to create an index on the view or something like that to speed up?

Thank you very much.

Best, Jens
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to