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

SELECT 1) FROM 2) INTO OR reverse

Former Member
0 Likes
998

Hello,

Is there any difference related to performance if I write a select clause with INTO first and FROM later or vice versa?

1) SELECT field 1 ...field 2 INTO TABLE it_mara

FROM mara

where .....

2) 1) SELECT field 1 ...field 2 FROM mara

INTO TABLE it_mara

where .....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
882

I don't think that there is a difference and if there is a difference, I would expect it in the 1% range.

Then you will have a hard time to measure it. Forget the SE30 in this case, it is much too inaccurate.

You would have to run a lot of repeats and measure without tool by using get runtime, but still there is

always a lot of variation in the DB-Select times.

the whole thing sounds to me as a starting point of a new myth .... with no content

Siegfried

7 REPLIES 7
Read only

former_member156446
Active Contributor
0 Likes
882

easiest solution is to test in SE30 and hit tips and tricks button and write the code in there...and compare the code, execution time.

Read only

Former Member
0 Likes
882

As per my knowledge there is no such advantage if you want to find out check on SE30 but run the second after sometime since once you run one it gets buffered.

Nafran

Read only

Former Member
0 Likes
882

Hi,

1) SELECT field 1 ...field 2 INTO TABLE it_mara

FROM mara

where .....

2) 1) SELECT field 1 ...field 2 FROM mara

INTO TABLE it_mara

where .....

In 1) compiler read the Internal table first and assigns field1, field2.....etc., corressponding values o the it_mara. After get the field values from MARA and assign into it_mara.

However In 2) get the fields from MARA and assign those fields with values into it_mara.

By comparing both two, 2nd Query takes little bit time than 1st.

However it wont affect the delay in Report.

Regards,

Vimal.

Read only

HermannGahm
Product and Topic Expert
Product and Topic Expert
0 Likes
882

>

> 1) SELECT field 1 ...field 2 INTO TABLE it_mara

> FROM mara

> where .....

>

> 2) 1) SELECT field 1 ...field 2 FROM mara

> INTO TABLE it_mara

> where .....

>

> In 1) compiler read the Internal table first and assigns field1, field2.....etc., corressponding values o the it_mara. After get the field values from MARA and assign into it_mara.

>

> However In 2) get the fields from MARA and assign those fields with values into it_mara.

>

> By comparing both two, 2nd Query takes little bit time than 1st.

Hi Vimal,

interesting... how did you find out and meassure? could you show me your testcase?

Kind regards,

Hermann

Read only

HermannGahm
Product and Topic Expert
Product and Topic Expert
0 Likes
882

>

> Is there any difference related to performance if I write a select clause with INTO first and FROM later or vice versa?

No.

Read only

Former Member
0 Likes
883

I don't think that there is a difference and if there is a difference, I would expect it in the 1% range.

Then you will have a hard time to measure it. Forget the SE30 in this case, it is much too inaccurate.

You would have to run a lot of repeats and measure without tool by using get runtime, but still there is

always a lot of variation in the DB-Select times.

the whole thing sounds to me as a starting point of a new myth .... with no content

Siegfried

Read only

Former Member
0 Likes
882

Difference = 0 !