Solved

Forcing Informix to use index

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now