Well, here is the query:
SELECT MIN(test) FROM test WHERE stime BETWEEN '2004-01-08-00.00.00' AND '2004-01-08-23.59.59'
we have indexes both on test and stime column respectively. When I create the explain it shows me that it is picking the index created on column test, BUT I want it to pick the one on stime, as it makes it faster.
HTH to understand the issue. The stat on the table and indexes are current.
dollar
Quote:
Originally posted by Marcus_A
Obviously, you cannot explicitly force DB2 to use a specific index over another in the SQL statement. Whether it is possible to influence DB2 depends on several factors.
If you give the table and index DDL with statistics (row count) and some information about distribution of index values (full key card), and the SQL statement in question, then we may be able to help.
Also, please explain why you want DB2 to use an index it does not ordinarily choose.
|