Bookshelf Home | Contents | Index | PDF |
Siebel Analytics Server Administration Guide > Creating and Administering the Physical Layer in a Repository > Using Database HintsDatabase hints are instructions placed within a SQL statement that tell the database query optimizer the most efficient way to execute the statement. Hints override the optimizer's execution plan, so you can use hints to improve performance by forcing the optimizer to use a more efficient plan. NOTE: Hints are database specific. Siebel Analytics Server supports hints only for Oracle 8i and 9i servers. Using the Administration Tool, you can add hints to a repository, in both online and offline modes, to optimize the performance of queries. When you add a hint to the repository, you associate it with database objects. When the object associated with the hint is queried, the Analytics server inserts the hint into the SQL statement. Table 16 shows the database objects with which you can associate hints. It also shows the Administration Tool dialog box that corresponds to the database object. Each of these dialog boxes contains a Hint field, into which you can type a hint to add it to the repository. Usage ExamplesThis section provides a few examples of how to use Oracle hints in conjunction with the Siebel Analytics Server. For information about Oracle hints, see the following Oracle documentation: Oracle8i Tuning for reference information, and Oracle8i SQL Reference for descriptions about Oracle hints and hint syntax. Index HintThe Index hint instructs the optimizer to scan a specified index rather than a table. The following hypothetical example explains how you would use the Index hint. You find queries against the ORDER_ITEMS table to be slow. You review the query optimizer's execution plan and find the FAST_INDEX index is not being used. You create an Index hint to force the optimizer to scan the FAST_INDEX index rather than the ORDER_ITEMS table. The syntax for the Index hint is index(table_name, index_name). To add this hint to the repository, navigate to the Administration Tool's Physical Table dialog box and type the following text in the Hint field: index(ORDER_ITEMS, FAST_INDEX) Leading HintThe Leading hint forces the optimizer to build the join order of a query with a specified table. The syntax for the Leading hint is leading(table_name). If you were creating a foreign key join between the Products table and the Sales Fact table and wanted to force the optimizer to begin the join with the Products table, you would navigate to the Administration Tool's Physical Foreign Key dialog box and type the following text in the Hint field: Performance ConsiderationsHints that are well researched and planned can result in significantly better query performance. However, hints can also negatively affect performance if they result in a suboptimal execution plan. The following guidelines are provided to help you create hints to optimize query performance:
NOTE: If you drop or rename a physical object that is associated with a hint, you must also alter the hints accordingly. Creating HintsThe following procedure provides the steps to add hints to the repository using the Administration Tool.
|
Siebel Analytics Server Administration Guide |