Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed up SQL
Message
De
12/06/2013 04:02:09
 
 
À
11/06/2013 15:36:32
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01576055
Message ID:
01576099
Vues:
43
>>>
ALTER PROCEDURE [dbo].[InvoicesSelectOutstanding]
>>>	WHERE inv_date <= @crt_date
>>>		AND inv_printed = 1
>>>		AND inv_cancelled is null
>>>         -- AND cus_credit = 1
>>>	ORDER BY cus_company
>>>
>>>This takes quite a while to run (47 seconds).
>>>
>>>If I uncomment the second to last line (AND cus_credit = 1) it runs in under 2 seconds.
>>>The execution plan seems to tell me that everything is OK and I have indexes on all the joining and where fields.
>>>Any suggestions on how to speed this up?
>>
>>What if you put AND cus_credit > -1 instead of commenting the line?
>
>That didn't make any difference, thanks. FYI: cus_credit is a boolean field
>Is there any way to post the execution plan here for someone to look at?

you might try something along
and cus_credit*10 = 10
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform