Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement