Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing a SQL command
Message
De
13/09/2013 11:40:26
 
 
À
13/09/2013 11:29:14
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01583170
Message ID:
01583176
Vues:
45
Michel,

Just a general question...do you have indexes defined for the following tables:

TASK: NoRobot, NoRobotTimeFrame, AddUser, ModUser
Robot: Numero
Server: Numero
RobotTimeFrame: Numero
Member: Numero

Obviously, you need to weight the benefits of any one index with the cost of maintaining that index when new rows are inserted.

Just a suggestion - sometimes a self-join is better optimized by instead running a subquery...for instance, you join into Member twice. There's no hard and fast rule, but sometimes creating a temporary result set definition can perform better than a self-join. But based on the # of rows you're describing, it might not make much difference.

Without any selectivity (WHERE clause), you're basically left with making sure the indexes cover the query. (And by the way, creating covering indexes to include the non-key columns you retrieve in the SELECT can further boost performance....though again, at the possible expense of time to insert new rows)

So you might have a bit of research work ahead of you to add/tweak any indexes, and perhaps investigate covering indexes.

Hope this helps...

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform