Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
You gotta love them
Message
 
 
À
03/08/2012 21:22:46
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Indexation
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01549940
Message ID:
01549943
Vues:
55
>It's the kind of thing that can make you a believer. Had an SP that was updating a table with about 400 changes. Table has 5 million + records.
>
>Was taking 16 min. Made sure join was done using the clustered pk index ( compound - 3 columns - one not really needed so at first i was only using 2 of them - bad idea ) and since I knew all changes were on rows where tradate ( datetime ) which has an index of its own even though it is part of PK, was 2 days ago or later, added a where clause filtering out older records.
>
>16 min to subsecond with a total of about 12 words of code.
>
>Happy Friday.

As the old joke puts it, you have to know which 12 words of code ;-) Good job!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform