‎2008 Aug 14 1:04 PM
select * from dfkkop into corresponding fields of table t_dfkkop
where vtref like 'EPC%' and
( ( augbd = '00000000' and
xragl = 'X' )
or
( augbd ge w_clrfr and
augbd le w_clrto ) ) and
augrd ne '03' and
zwage_type in s_wtype.
this select statement taking huge time to retrieve the records.
Can we suggest me any alternative to this statement?
Regards,
sam.
‎2008 Aug 14 4:03 PM
select *
from dfkkop
into corresponding fields of table t_dfkkop
where vtref like 'EPC%'
and ( ( augbd = '00000000' and xragl = 'X' )
or ( augbd ge w_clrfr and augbd le w_clrto ) )
and augrd ne '03'
and zwage_type in s_wtype.
I doubt that your problem can be solved by a fieldlist instead of the SELECT *
Performance problems are related to missing index support in ost cases, and that is here also the case.
Check SE11 for dfkkop and indexes ... you need either fields in your WHERE condition which are leading fields of an index or you need an index with your fields.
=> I can't see anything.
The 'ne' not equal condition can not be used on an index.
augbd ge w_clrfr and augbd le w_clrto => augbd between w_clrfrand and w_clrto
Maybe you can find additional and better conditions.
Siegfried
‎2008 Aug 14 1:07 PM
Hi,
Create a internal table with the same table type of the database table and do not use corresponding statement.
select * from dfkkop into table t_dfkkop
where vtref like 'EPC%' and
( ( augbd = '00000000' and
xragl = 'X' )
or
( augbd ge w_clrfr and
augbd le w_clrto ) ) and
augrd ne '03' and
zwage_type in s_wtype.And if you do not nee all the fields of the table dfkkop then select those Particular fields rather than all.
For this create internal table with those fields that are selected in select statement and as the where conditionis complecated it will take little time.
‎2008 Aug 14 2:30 PM
Don't use SELECT * define the fields which u want and fetch the data for that fields and give the same in SELECT query,
SELECT * will take lot of time and PERFORMANCE it is not good
‎2008 Aug 14 2:38 PM
Hello
This much slows your programm.
augrd ne '03'
Make ranges for augrd, fill this by valid values and
augrd in r_augrd
‎2008 Aug 14 4:03 PM
select *
from dfkkop
into corresponding fields of table t_dfkkop
where vtref like 'EPC%'
and ( ( augbd = '00000000' and xragl = 'X' )
or ( augbd ge w_clrfr and augbd le w_clrto ) )
and augrd ne '03'
and zwage_type in s_wtype.
I doubt that your problem can be solved by a fieldlist instead of the SELECT *
Performance problems are related to missing index support in ost cases, and that is here also the case.
Check SE11 for dfkkop and indexes ... you need either fields in your WHERE condition which are leading fields of an index or you need an index with your fields.
=> I can't see anything.
The 'ne' not equal condition can not be used on an index.
augbd ge w_clrfr and augbd le w_clrto => augbd between w_clrfrand and w_clrto
Maybe you can find additional and better conditions.
Siegfried