I was getting some annoying intermittent timeout exception on my personal site (see My Site in top nav)
timeout expired.png (56.21 kb) (screenshot of the error)
As I didn't have time I figured it must have been something in my hosting setup but it became pretty annoying that I figured I should have a short look.
Turns out the [more] Random Photo feature was accessing a stored procedure which needed only the PhotoID, AlbumID, Caption but included the image content in the result set. Since multiple rows where returned (and randomization is made on C# code, it was one big chunk of unnecessary data being retrieved from the database).
So if you're running into a similiar issue then this is likely the culprit.
Uploading a SQL script containing added stored procedures to fix the issue and my modified PhotoManager.cs
It's relatively simple and we could think of a few more improvements but this would be enough at least for me for now.
My home page loads faster than before now and no more annoying timeout exception so hope this helps someone out there too.