Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A different approach for optimization
Message
De
28/02/2014 14:56:10
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
A different approach for optimization
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01595558
Message ID:
01595558
Vues:
70
I have a select like this:
DECLARE @Success Bit

SET @Success=1

SELECT CONVERT(CHAR(4),YEAR(Invoice.ModDate)) AS lcChampNumero,COUNT(*) AS Compte,MIN(Invoice.ModDate) AS AddDate
 FROM Invoice (NOLOCK)
 INNER JOIN InvoiceStatus ON Invoice.NoInvoiceStatus=InvoiceStatus.Numero
 INNER JOIN Client ON Invoice.NoClient=Client.Numero
 WHERE (Invoice.Success=@Success) AND Invoice.NoSomething=2
 GROUP BY CONVERT(CHAR(4),YEAR(Invoice.ModDate))
 ORDER BY 1 DESC
I am looking at an alternative to boost up performance here. In some occasions, this can be very long. There are indexes on every fields. However, this GROUP BY thing on a big table may take up to 10 to 50 seconds sometimes.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform