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 using primary key, does it depend on volume of data ?

Former Member
0 Kudos

Hi ,

I have a table (ZTEST) with two key fields , say, sales org (first key field ) and material.

Material ABC exists in sales orgs 001 and 002.

Total number of records in table for salers org 001 = 1 million

Total number of records in table for salers org 002 = 10000

If I select from ZTEST using

1 . sales org = 001 and material = ABC

2. sales org = 002 and material = ABC

will there be a significant time difference between the two queries ?

Regards,

Hari.

1 ACCEPTED SOLUTION

former_member192616
Active Contributor
0 Kudos

Hi Hari,

no, each of your query has to perform the same amount of I/O.

Since you are using the fully specified primary key both queries will

perform an index unique scan. This index uniques scan in both cases

has to read some inex blocks/pages depending on the height of the index

and in case of heap tables an additional table block/page.

Kind regards,

Hermann

1 REPLY 1

former_member192616
Active Contributor
0 Kudos

Hi Hari,

no, each of your query has to perform the same amount of I/O.

Since you are using the fully specified primary key both queries will

perform an index unique scan. This index uniques scan in both cases

has to read some inex blocks/pages depending on the height of the index

and in case of heap tables an additional table block/page.

Kind regards,

Hermann