Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2008
>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
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