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 with no Key Fields

Former Member
0 Kudos

Hi All,

I have a SQL statement with where condition. But in where condition, there is not a single KEY field is being used...

I am trying to add Dummy KEY fields( with no value Ex. select-option field for key field), to improve the performance...

Could you please suggest me, whether it will improve performance on not...

Thanks in Advance..

Regards

Manglesh

Moderator message - Please use a meaningful subject for your thread. This the Performance and Tuning Forum, so all questions are about "Performance Issues"

Edited by: Rob Burbank on Nov 19, 2009 11:39 AM

5 REPLIES 5

Former Member
0 Kudos

Probably not, but it's pretty hard to say without seeing the SELECT statement.

Rob

Former Member
0 Kudos

Manglesh,

It will help you very much to learn some basic SQL by reading a book. You should seriously consider that.

Putting key fields in the WHERE clause will help only if you are searching by those fields. If you are just putting FIELD IN S_FIELD and not specifying anything in S_FIELD will not help. In fact, open SQL doesn't even pass that clause to DB engine.

What will really help you is to create an index on the table using the field(s) that are in your WHERE clause.

Again, this all basic SQL. Nothing to do with ABAP or SAP. If you don't want to buy a book, there is tons of information on the Internet.

Good luck.

former_member194613
Active Contributor
0 Kudos

> Again, this all basic SQL. Nothing to do with ABAP or SAP.

this is not really true, the select options are Open SQL constructs (i.e. the SQL for ABAP and SAP), not used select-options are not forwarded by the database interface (SAP application server) to the database. With the effect you are right, they can not have any effect.

And the recommendation is also correct, learn more about SQL. Key fields are usually the fields of the primary key, any field can becomes a field of secondary index.

0 Kudos

>

... any field can becomes a field of secondary index.

Are you sure?

Rob

Former Member
0 Kudos

Hi Experts

My question is in similar lines..so posting it here

suppose a table has 11 key fields, and we extract data from it using select statement and in where condition I use 3 fields all of which are key fields.
now if I somehow manage to incorporate all the key fields in the where condition will it give any performance benefit?
(Note: Number of records selected has to be same in both pre and post condition)

Thanks

Sumanto