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

performance tunning

Former Member
0 Likes
738

Experts,

Please have a look at the code below,following select statement is taking

long time to fecth the records, problem is i cannot chnage these select

statement to introduce key filelds because scenario is like that,how can i make

these select statement tuned to work fine

SELECT *

FROM ZBW_SCH_LINES

INTO CORRESPONDING FIELDS OF TABLE INT_OPEN_SCH_LINES_1

WHERE

( MBDAT GE D0 AND MBDAT LE D3 ) AND

( ( ZDATE GE D0 AND ZDATE LE D3 ) .

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
713

Maybe you can add an index for the fields MBDAT and ZDATE to the table ZBW_SCH_LINES. Go to SE11, enter the table name and click change. Now , click go to, indexes. Here you can create a secondary index, enter the field names and save and activate.

Regards,

Rich Heilman

Read only

0 Likes
713

can you send me the entire step to do that,

Read only

Former Member
0 Likes
713

Looks like you don't need all the fields, but you still have *. See, if you can select the fields in the same order in which they appear in the fields INT_OPEN_SCH_LINES_1

AND TRY TO USE BETWEEN.

Try this


SELECT field1 field3 field4
FROM ZBW_SCH_LINES
INTO TABLE INT_OPEN_SCH_LINES_1
WHERE
( MBDAT BETWEEN D0 AND D3 ) AND
( ZDATE BETWEEB D0 AND D

3 ) .

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
713

It's a custom table. How is it updated - online or in batch. If in batch, you could create an index on mbdat and/or zdate.

The simplest thing to do would be to make sure that the interval between D0 and D3 is relatively small so that less data is returned.

Rob

Read only

Former Member
0 Likes
713

hi

try creating a range or a select-options and then populate d0 and d3 there is mbdat the primary key field for the table. if not try to use the primary key aswel in where condition.

donot copy all the fields and donot use corresponding fields select by name in sequence

all these can reduce the time

u can even give a secondary index for the table

santhosh

Read only

Former Member
0 Likes
713

To Improve the performance of SELECT statement you need to change select query in below areas

1. In the place of '' use Fieldlist (What are fileds you are using- the filedlist more than 1/3 better to use '').

2. Avoid INTO CORRESPONDING FIELDS clause (Define own internal table in program- it can avoid the corresponding clause)

3. As above rich told, Use secondary index for MBDAT,ZDATE for past DB Acess

Reagrds

Bhupal Reddy

Read only

Former Member
0 Likes
713

1) Avoid using * in select instead of tht use field names in the same order they come in table.

2) dont use into corresponding fields instead of tht use into table (internal table )

I hope this hepls u .. if so plz reward points

Regards

Kali Pramod.