General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Network:
Windows 2008 Server
>Hi,
>
>I'm doing a query which joins a customer table to a sales table (cab_inv) and for some reason the join doesn't want to pick up an index on customer number on the sales table (simple index on cust_num, index "cust_num2"), if I do a simple select only on the sales table and include in the where clause the customer number it picks up the index, now to make it more interesting if I go back to the join and I hard-code the customer number then the index is used. Any clues? image below and the optimizations, the first 4 lines is for the select on the sales table only and the index "cust_num2" kicking in, the rest if for the join and the index not kicking in.
>
It means that Rushmore thinks creating a temp index is faster. Is the query too slow?
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only