Speeding up database access - part 4 Fixing expensive queries

  • When you're trying to update and select information at the same time, wouldn't it be simpler to use OUTPUT:

    UPDATE dbo.Book

    SET LastAccess = GETDATE()

    OUTPUT INSERTED.Title, INSERTED.Author

    WHERE BookId = @BookId

    (I believe you can get similar results in Oracle with RETURNING)

  • sankalpa (8/31/2011)


    SmallDateTime data type also help when optimizing the datatype

    Be careful with that. It's only accurate to the minute. So 23:59:30 = 0:00:00 when using smalldatetime and that can mess up date range tests unless you're careful. Date is good though if you are only storing date.

  • I'm having trouble with slow Update queries, and all the performance tuning articles talk about Select queries. Any link to tuning Update queries? Or should I post my query here? 🙂

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply