Home Forums SQL Server 2008 SQL Server 2008 Performance Tuning Query to Table containing column of data type geography takes more than 30 seconds to execute every days during his d RE: Query to Table containing column of data type geography takes more than 30 seconds to execute every days during his d

  • Hugo Kornelis (2/16/2016)


    Almost certainly, the data has been removed from the buffer pool overnight, so it has to be read in from disk again. Then it is accessed frequently enough that it remains in the buffer pool.

    Until the nightly maintenance kicks in and does a lot of work, forcing SQL Server to remove stuff it has not used for a few hours out of the buffer pool, and the process restarts.

    If this is problematic, create a job that does a SELECT GeographyColumn FROM YourTable (without WHERE clause) and discards the results, and ensure that this job runs when all other maintenance work is done and before the normal business starts.

    Also, if you are running on a VM, ask your VM manager if they are doing any memory balloon work overnight. If they say yes, tell them to stop doing that.