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

low performance -select select single *

Former Member
0 Likes
635

hi,

can you provide the alernative to

select single * to increase the performance

6 REPLIES 6
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
586

Hi,

If you want to get the best performance with SELECT SINGLE only way out is to have all the fields of the primary key in the WHERE clause.

Regards,

Sesh

Read only

Former Member
0 Likes
586

Hi Shyam,

Most of performance problem are du to the way ( the table chain) to retrieve the data, not the statement you use.

The "select single" statement is performant. But do you fill all the table key in your "where clause" ?

Read only

Former Member
0 Likes
586

Hi,

Don't use Select Single *, but try specify your field.

SELECT SINGLE Field1 Field2 FieldN ...

FROM TableName

INTO (Field1, Field2, FieldN, ... )

WHERE (your where condition here ).

Regards,

Read only

christian_wohlfahrt
Active Contributor
0 Likes
586

Hi,

a select single with (primary) index access will be faster - and there is no faster way. But when you don't have index access, no other select will be faster, too.

Only when you make the select single inside a loop, the thousands of repetitions will summarize to some time. Here a select for all entries outside of the loop should be faster.

Read only

Former Member
0 Likes
586

select single is a good performance clause ... but try specifying the fields you want to retiree plus in the where clause try to specify all the primary fields in the table this will improve the performance considerably .an exact alternative is using upto 1 rows but select single in better than upto one rows.

pl .provide point if found helpful.

Read only

0 Likes
586

hi

u have to use the select single only if u have full primary key..otherwise u will not get the expected resuet.. suppose

select single * from vbap 
into wa_vbap 
where vbeln = xxxx and 
          posnr = xxxx.

if u dont have the POSNR value the use upto 1 rows..

select * from
 vbap into wa_vbap 
 up to 1 rows
 where vbeln = xxxx
end select.