Hi,
An ability to influence the behaviour and functioning of the optimizer component with the SQL is called Optimizer Directives or Hintings.
To ignore an existing index in a table, Informix provides syntax as below:
{ +AVOID_INDEX( tabellenname, indexname ) }
or
--+AVOID_INDEX( tabellenname, indexname )
Example:
select --+ AVOID_INDEX(customer, cust_id_u_idx)
* from customer where cust_id='ACZ00453' ;
To see what it did with this directive:
select --+ AVOID_INDEX(customer, cust_id_u_idx) explain
* from customer where cust_id='ACZ00453' ;
If your intension is to avoid index only, you can do it by nagation of the condition like:
select * from customer where cust_id !='0' ;
This will force the optimizer to resort into sequential scan of the object.
Slightly off-subject:
In very rare cases, the optimizer refuse to use an existing index. Hence you can use:
{ +USE_INDEX( tabellenname, indexname ) }
However, it is to be noted that Optimizer Directive or Hintings will work only if your $INFORMIXDIR/etc/$ONCONFIG parameter file contains the object enabled. It is:
DIRECTIVES 1
Regards,
Shriyan