Oracle8i interMedia Text Reference Release 2 (8.1.6) Part Number A77063-01 |
|
Query Tuning, 4 of 5
By default, queries are optimized for throughput under the CHOOSE and ALL_ROWS modes. When queries are optimized for throughput, Oracle returns all rows in the shortest time possible.
In FIRST_ROWS mode, the extensible query optimizer optimizes for fast response time by having the Text domain index return score-sorted rows, if possible. This is the default behavior when you use the FIRST_ROWS hint.
If you want to optimize for better throughput under FIRST_ROWS, you can use the DOMAIN_INDEX_NO_SORT hint. Better throughput means you are interested in getting all the rows to a query in the shortest time.
The following example achieves better throughput by not using the Text domain index to return score-sorted rows. Instead, Oracle sorts the rows after all the rows that satisfy the CONTAINS predicate are retrieved from the index:
select /*+ FIRST_ROWS DOMAIN_INDEX_NO_SORT */ pk, score(1), col from ctx_tab where contains(txt_col, 'test', 1) > 0 order by score(1) desc;
See Also:
For more information about the query optimizer and using hints such as FIRST_ROWS and CHOOSE, see Oracle8i Concepts and Oracle8i Designing and Tuning for Performance. |
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|