Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
You gotta love them
Message
 
 
To
03/08/2012 21:22:46
General information
Forum:
Microsoft SQL Server
Category:
Indexing
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01549940
Message ID:
01549943
Views:
54
>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!
Previous
Reply
Map
View

Click here to load this message in the networking platform