RE: Forcing the use of an index
Posted in 2004
I found this in my documents, but I haven't tested it yet: AVOID_FULL Directive The AVOID_FULL directive does not perform a full table scan on a listed table. The optimizer considers the various indexes that have been created that it can scan. If no index exists, the optimizer will perform a full table scan. In the example above, the optimizer is forced to consider the indexes created for this table emp. If no indexes exist, the optimizer performs a full table scan. Note Multiple directives can be used as long as they are in the same comment block. For example: SELECT --+AVOID_FULL(e),INDEX (e salary_indx) name, salary FROM emp e WHERE e.dno = 1 AND e.salary > 5000; Note You must refer to the tables alias in the directives if you have used an alias in the SQL statement. The example above shows that the emp table is referred to with the alias in the optimizer directives. -----Original Message----- From: owner-informix-list@iiug.org [mailto:owner-informix-list@iiug.org] On Behalf Of David Reed Sent: Friday, July 09, 2004 3:07 PM To: informix-list@iiug.org Subject: Forcing the use of an index Hi If I have more than one index on a table, how do I force the use of a specific index, on a select statment? Can I do it in the creation of a view? Is there any documentation on this issue that I can look at? David Reed david.reed@compuwin.co.za sending to informix-list ________________________________ << ella for Spam Control >> has removed Spam messages and set aside Newsletters for me You can use it too - and it's FREE! www.ellaforspam.com sending to informix-list