Saturday, June 20, 2015

Facts of SQL?

GetDate()

The call to GETDATE() will return both the date and the current time, which very likely not match the data in the date field, whether the date only was stored or both the date and time were stored. The worst case is where both the date and time are stored in the field and only the date is really of interest. It will then be very difficult to query this table by date without using range searches or a function that converts the date and time on every row to just a date


AUTO_SHRINK

The AUTO_SHRINK option could have the most negative impact on a production database. This is because a database shrink could be issued during the middle of production queries, causing slowdowns or locking issues. Typically you would schedule database shrinks for off hours. The AUTO_CLOSE option is also a negative impact to production as whenever all users are disconnected, the database will close. Reopening it causes a delay in response from the server.

Read only doesn't impact the performance of the server, just prevents writes. This is an option you may want enabled in production.

Recovery full isn't an option and Auto_Update_Statistics is recommended as being left on to ensure the query optimizer has reliable statistics for queries. Torn page detection should always be enabled to prevent corruption, and this doesn't negatively impact production servers

No comments: