Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RE:performance issue

Former Member
0 Likes
627

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
597

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

4 REPLIES 4
Read only

Former Member
0 Likes
597

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.

Read only

former_member585060
Active Contributor
0 Likes
597

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

Read only

Former Member
0 Likes
597

Hello

This much slows your programm.


augrd ne '03'

Make ranges for augrd, fill this by valid values and


augrd in r_augrd

Read only

Former Member
0 Likes
598

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