|Oracle Text Application Developer's Guide
Part Number A90122-01
Query Tuning, 4 of 5
Optimizing a query for throughput returns all hits in the shortest time possible. This is the default behavior.
The following sections describe how you can explicitly optimize for throughput.
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 Oracle 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;
Oracle9i Database Performance Guide and Reference for more information about the query optimizer and using hints such as FIRST_ROWS and CHOOSE.