Solved

Forcing Informix to use index

Posted on 2000-05-16
1
2,181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

728 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