Solved

Forcing Informix to use index

Posted on 2000-05-16
1
2,087 Views
Last Modified: 2012-05-04
Is it possible to force a SQL statement to use a particular index in Informix Database?

We have a scenario like this:
There are two indexes on a table. Informix optimizer by default selects one index while executing that query. Is it possible to make Informix use the other index on the table for that query ? If yes, how ?

I have Informix 7.30 on HP-UX.
0
Comment
Question by:Tikshya
1 Comment
 
LVL 2

Accepted Solution

by:
afpcos earned 50 total points
ID: 2821828
You can go to Informix web site and look at tech notes volume 9, Issue 1, 1999.

New to Informix 3.0
Optimizer Directives

Example:
SELECT --+ ordered index(customer, zip_ix) avoid_index(orders," 101_4")
customer.lname, orders.order_num, items.total_price
FROM customer c, orders o, items i
WHERE c.customer_num = o.customer_num
AND o.order_num = i.order_num
AND stock_num = 6
AND man_code = "SMT"

This forces the database engine to use the zipcode index on the customer table and avoid using the index on the orders table.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question