‎2009 Jun 24 1:12 AM
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 .....
‎2009 Jun 24 9:21 AM
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
‎2009 Jun 24 4:00 AM
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.
‎2009 Jun 24 5:24 AM
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
‎2009 Jun 24 6:05 AM
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.
‎2009 Jun 24 8:01 AM
>
> 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
‎2009 Jun 24 7:52 AM
>
> Is there any difference related to performance if I write a select clause with INTO first and FROM later or vice versa?
No.
‎2009 Jun 24 9:21 AM
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
‎2009 Jun 24 9:35 AM