rspec/rules/S1512/abap/rule.adoc

40 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
ABAP hints can be used to override the default behavior of the SAP Cost Based Optimizer (CBO). When the execution plan provided by the CBO is not optimal, it is possible to "drive" the CBO by providing the main index to be used to filter rows.
Such optimizations are not portable from one database to another, such as when migrating from Oracle to DB2. Therefore hard coding an optimization should be done only when it is strongly indicated.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2021-04-28 16:49:39 +02:00
----
select MY_COLUMN
into it_data
from MY_TABLE
WHERE FILTERING_COLUMN = '0'
%_HINTS ORACLE 'INDEX("MY_TABLE" "MY_INDEX")'.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Make sure this use of %_HINTS is required in this context
'''
== Comments And Links
(visible only on this page)
=== on 8 Jan 2014, 00:29:22 Ann Campbell wrote:
Please double-check my compliant solution. I'm guessing that the period at the end of the non-compliant example is a "the select ends here" marker...
endif::env-github,rspecator-view[]