Types of Recognized Hints Query Hints Syntax

4-20 Oracle Fusion Middleware System Administrators Guide for Oracle Content Server WHERE Revisions.dReleaseState = NN AND Revisions.dStatus in NDONE, NRELEASED, NDELETED AND Revisions.dInDate={ts 2005-02-23 17:46:38.321} The optimized result for the query uses the index for dReleaseState: SELECT+ LEADINGRevisions INDEX Revisions dReleaseState dID FROM Revisions WHERE Revisions.dReleaseState = NN AND Revisions.dStatus in NDONE, NRELEASED, NDELETED AND Revisions.dInDate={ts 2005-02-23 17:46:38.321}

4.2.5.4 Types of Recognized Hints

Oracle Content Server queries can be static queries defined in various resources, data sources with additional dynamic WHERE clauses, and dynamic queries that are ad-hoc or defined in the application such as Archiver. Static queries can be updated with Oracle database hints. However, it is nearly impossible to predefine hints for ad-hoc queries and dynamic WHERE clauses. Content Server hints use a database-neutral hint syntax that supports multiple hints in the same query. An Oracle Content Server hint can be used in any query, data source, and WHERE clause. However, it cannot be combined with an Oracle database hint. If a query contains both types of hints, Oracle Query Optimizer will retain the Oracle database hint and ignore the Content Server hint.

4.2.5.5 Query Hints Syntax

During the optimization processing stages, Oracle Query Optimizer recognizes the distinct syntaxes of both types of hints and correspondingly processes the submitted query. For more detailed information, see Section 4.2.5.2, Query Optimization Process.

4.2.5.5.1 Oracle Hint Syntax An Oracle hint uses the following format:

+ hint For example: + IndexRevisions dID

4.2.5.5.2 Oracle Content Server Hint Syntax The Oracle Content Server hint syntax is

database neutral and can support multiple Oracle Content Server hints in the same query. During the optimization process, Oracle Content Server hints are evaluated and the best hints are formatted and added back to the query. During the optimization process, a query that includes one or more Oracle Content Server hints is not parsed. Only Oracle Content Server hints are considered when choosing indexes. ■ Oracle Content Server Hint Syntax: When a query undergoes the optimization process, Oracle Content Server hints are added to the reformatted query using the following syntax: tableName[ aliasName]:columnName[:operator [:value]][, …] Where: – Values enclosed in angle brackets value are required. Managing System Settings 4-21 – Values enclosed in brackets [value] are optional. – Ellipses … indicates a repetition of the previous expressions. ■ Query Before Optimization Process: SELECT FROM Revisions, DocTypes, RoleDefinition WHERE Revisions:dStatusRevisions.dStatusDELETED AND Revisions.dStatusEXPIRED AND Revisions.dStatusRELEASED AND Revisions.dDocType = DocTypes.dDocType AND Revisions:dReleaseStateRevisions.dReleaseStateE AND Revisions.dSecurityGroup = RoleDefinition.dGroupName AND RoleDefinition.dRoleName = ? AND RoleDefinition.dPrivilege 0 ■ Reformatted Query with Oracle Content Server Hints Added: After the query has undergone the optimization process, both indexes are used and are added to the native indexes. SELECT+ LEADINGrevisions INDEX revisions dStatus dReleaseState FROM Revisions, DocTypes, RoleDefinition WHERE Revisions.dStatusDELETED AND Revisions.dStatusEXPIRED AND Revisions.dStatusRELEASED AND Revisions.dDocType = DocTypes.dDocType AND Revisions.dReleaseStateE AND Revisions.dSecurityGroup = RoleDefinition.dGroupName AND RoleDefinition.dRoleName = ? AND RoleDefinition.dPrivilege 0

4.2.5.6 Additional Supported Sort Constructs