Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to force the db to use an index

Status
Not open for further replies.

larryh77

Programmer
Oct 9, 2006
3
0
0
US
We are using PowerBuilder 9 with Sybase and Oracle as back ends. One of the queries is taking too long. It uses the "in" clause for an array argument and I see that the index I want to use is not being used.

Of course when I change the query to read "where emp_id = :ll_emp_id" instead of "where emp_id in :)ll_emp_ids)" then it uses the emp_id index and performance is great.

Anyway to force it to use the emp_id index when I need to query on multiple emp_ids?
 
Hi Larry,

The query seems ok. Remove order by if included in query and use datawindow sort function to sort recordset.

When you use order by then index is not used.

Please let me know if it works.

Regards,
Abhijit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top