Application Development 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: 

Select single performence issue

Former Member
0 Kudos

Hi All,

Actually i need to improve one Report performence. SELECT SINGLE with out primary keys used in the report,While checking Runtime analysis for the Report,Only select single is taking more time.

Could you please tel me,If i replace select single with select upto 1 rows,it will improve performence or not.

Thanks so much.

11 REPLIES 11

Former Member
0 Kudos

Hi

I don't believe the performance can be improved by replacing SELECT SINGLE with UP TO 1 ROWS, the main problem could be the fields used in WHERE condition are not keys or are not in a index

Max

0 Kudos

Hi Max,

Thanks Max for your reply.

yes select single used without primary keys.

but now i cant include the primary keys.. is there any other way to improve the performence without replacing with select upto 1 rows.

Thanks again.

0 Kudos

If you need to get the data with a single selection, I believe it has to generate an index with the fields used in WHERE condition else

if it's possible you can try to get the primary key by a query in another tables linked with your table

Max

0 Kudos

please, if possible, could you send the select single?

former_member202771
Contributor
0 Kudos

Hi Trinadh,

When no primary key is used, Secondary index has to be used.

Thanks,

Anil

Former Member
0 Kudos

HI Trinadh,

If you do not want to use primary key of the table either in fetching the data or in where condition.It's better to use select up to 1 rows or creating a secondary index based on your select statement.

In least case you can go with it.Just add the primary key in your where condition of select statement as below.

Note: Example Where vbeln like '%'.

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you tell me how many times this statement is being executed? on which table and how many entries do you in this table?

Secondary key has to be created for this field in the table. Also please check how many secondary keys are available in that table

Former Member
0 Kudos

Thanks all.

my problem solved.

I have included primary keys by adding some logic.

but still my doubt is,if we are not able to use select single with all primary keys,we should create secondary indexes?

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes. You should create secondary indexes for better performance if your where clause has non index keys.

Aslo if your table has less entries and you are using it multiple times, then better select all the entries place it in global table, sort on the filed for which u want to read and read it with binary search

0 Kudos

Hi,

You may use Select... Upto 1 Row instead of the Select Single. if it is partial primary key.

If you want to avoid the End Select., then code it as follows

Select..

   From...

   Into ...

   up to  ...

Where ...

If your selection does not have any of the primary key ideally you have to create the Secondary index.

Regards

Muralee

raymond_giuseppi
Active Contributor
0 Kudos

Basically no much performance improvement is to be expected without either creation of new indexes or identification of other tables to execute intermediary JOIN as described in some OSS notes (Look with keywords "Performance" "Customer developments" for SD, MM/WM and PP/PM.

Regards,

Raymond