Solved

Forcing Informix to use index

Posted on 2000-05-16
1
2,128 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Read about achieving the basic levels of HRIS security in the workplace.
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…

679 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