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: 

performance issue while using select single query

Former Member
0 Kudos

hi all,

While using the select single statment performance getting slow

SELECT SINGLE NODENAME

INTO W_CUST

FROM /BI0/HCUSTOMER

WHERE NODEID = W_CUSTOMER-PARENTID.

in where condition given field is secondary key(PARENTID)

This table Technical setting given below

1. data class --customer data class

2. size category --4(expected data record 13.000 to 520.000

but at present my table number of entries (1.544.092)

3. buffering switched on

4. buffer type generic ( no.of key fields 2)

note my tabel has 10 fields in it 3 primary key fields and one secondary fields(PARENTID),

please give me solution to increase the performance

reward asured

with regards,

Thambe

8 REPLIES 8

former_member195698
Active Contributor
0 Kudos

create secondary index on field NODEID for the table

valter_oliveira
Active Contributor
0 Kudos

Hello.

Run ST05 to check which index is being used.

Are you saying that you created an index for field PARENTID? In that query it won't help. You should create a secondary index with NODEID field.

Regards.

Valter Oliveira.

0 Kudos

HI,

NODEID is primary key fields field only...

with regards,

Thambe

0 Kudos

Hi,

You have said that table have 3 primery key fields.

But in SELECT Query you are using only one primery key.

In Database table For The three primery key combination there is one record.

But for a particuler single primary key there may be multiple records. But in select statement you are fetching single record.

Thats why execution taking more time.

Regards,

sujit

Former Member
0 Kudos

Hi,

Whenerver You Use

SELECT SINGLE Statement ,In The WHERE Condition

you should use Only the PRIMERY KEYS/KEY FILELDS .

In your code you are not using key fields thats why perfomance

getting slow.

Thanks.

Former Member
0 Kudos

hi,

Try your query with

SELECT f ... FROM tab UP TO 1 ROWS

It will help you in performance issue.

Anirban Bhattacharjee

sujeet2918
Active Contributor
0 Kudos

hi ,

you can try this

select single xyz

into wa_x-xyz from x_table

and see in ST05 that your selection is using which Index.

If above doesnt work then create secondary Index for ur field.

reward points if this helps........

Former Member
0 Kudos

Hi,

The purpose of using the below statement is to pick the exact record without having an impact on the performance .

When using the query Select Single *,

1) It is important to make use of primary key fields in the 'Where clause'.

2) The sequence of the Key field in the 'Where Clause' should be same as defined in the Table. It would have an considerable impact on the performance if the sequence of key fields does not match the sequence defined in the std table.

Regards

Kiran Kumar V