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

Delayed output

Former Member
0 Likes
645

Hi Gurus,

following query is taking a very long time

SELECT belnr gjahr buzei bukrs xstov augdt blart

INTO CORRESPONDING FIELDS OF TABLE it_bsis

FROM bsis

WHERE hkont IN glac

AND blart IN s_blart

AND budat IN dtfmto

AND shkzg IN p_shkzg.

There are 3408816 entries in bsis table. is there any possible way to make query with faster output.

Regards

Rajesh Kumar

4 REPLIES 4
Read only

Former Member
0 Likes
617

Hi,

First: Don't use corresponding fields. Instead create a new internal table with the fields which you are selecting from BSIS.

Second: I believe there are no indexes being used here! You can check that in ST05 (SQL trace)

Regards

Nishant

Read only

0 Likes
617

Hi Nihant,

I have changed my query to as below.

SELECT belnr gjahr buzei bukrs xstov augdt blart

INTO TABLE it_bsis

FROM bsis

WHERE hkont IN glac

AND blart IN s_blart

AND budat IN dtfmto

AND shkzg IN p_shkzg.

It still taking very long time.

How can i use ST05 to trac sql.

Regards

Rajesh Kumar

Read only

0 Likes
617

> Hi Nihant,

> I have changed my query to as below.

>

> SELECT belnr gjahr buzei bukrs xstov augdt blart

> INTO TABLE it_bsis

> FROM bsis

> WHERE hkont IN glac

> AND blart IN s_blart

> AND budat IN dtfmto

> AND shkzg IN p_shkzg.

> ill taking very long time.

>

> How can i use ST05 to trac sql.

>

> Regards

>

> Rajesh Kumar

I know b'coz the other problem is that there is no usage of index!

what you can do is open ST05 in another session.

Then do start trace.

Then execute your program

Then do deactivate trace

Then display

Find BSIS.

Then select that line and press 'EXPLAIN'

This will show which INdex was used by this query.

In case no index is used then you can just look at indexes already present in system for this table and try to use those.

Regards

Nishant

Read only

0 Likes
617

Hi Rajesh,

Select query where clause condition is in wrong order change it as like below it will surely improve the performance

SELECT belnr gjahr buzei bukrs xstov augdt blart

INTO TABLE it_bsis

FROM bsis

WHERE hkont IN glac

AND budat IN dtfmto

AND blart IN s_blart

AND shkzg IN p_shkzg.

Reward the points if its useful

Regards

Manikumar