General information
Forum:
Microsoft SQL Server
Environment versions
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!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only