Some tips for using SQL Server 2016 distributed queries Try to avoid using distribution queries or minimize it using. Because distribution transactions incur more overhead than general transactions, avoid using distribution queries, whenever possible. The first steps to optimize distributed queries against a SQL Server 2016 linked server is rewriting queries so, that the most work will be performed on...
Tag: performance
Some tips for using query hints in SQL Server 2016
Some tips for using query hints in SQL Server 2016 If your query is very slow, try the following before using query hints: – rebuild indexes used in the query (or defragment them using DBCC INDEXDEFRAG), – update statistics on the relevant tables, – consider creating new indexes for this query, – rewrite your query to provide better execution plan. […]
Some tips for using full-text search in SQL Server 2016
Some tips for using full-text search in SQL Server 2016 Use a full-text query instead of the LIKE Transact-SQL predicate if you need to query formatted binary data or query a large amount of unstructured text data. A full-text query against millions of rows of text data can take only seconds; whereas a LIKE query against the same data can […]
Some tips for using User-Defined Functions in SQL Server 2016
Some tips for using User-Defined Functions in SQL Server 2016 Use scalar user-defined functions when you need to do the same mathematical calculations at multiple places in code. For example, if you need to calculate the factorial for the given number, you can write appropriate scalar user-defined function to encapsulate code for reuse. Consider using CLR user-defined functions. The CLR […]
Some tips for using SQL Server 2016 file and filegroups
Some tips for using SQL Server 2016 file and filegroups Do not set the autoshrink feature. Autoshrinking results in some performance degradation, therefore you should shrink the database manually or create a scheduled task to shrink the database periodically during off-peak times, rather than set Autoshrink feature to ON. Place log files on RAID 1+0 (or RAID 1) disks. By […]
Some tips for using bulk copy in SQL Server 2016
Some tips for using bulk copy in SQL Server 2016 Consider using minimally logged bulk copy whenever possible. The minimally logged bulk copy is much faster than other bulk copy methods, but to use it you must provide all the following conditions: 1. The database option ‘select into/bulkcopy’ is set to true (by the way, using this option causes the […]
Some useful SQL Server 2014 trace flags
Some useful SQL Server 2014 trace flags Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. You can set trace flags by using the DBCC TRACEON command or by using the -T option with the sqlservr command-line executable. There are 2 types of trace flags in SQL Server 2014: – global trace […]
Some useful SQL Server 2014 trace flags
Some useful SQL Server 2014 trace flags Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. You can set trace flags by using the DBCC TRACEON command or by using the -T option with the sqlservr command-line executable. There are 2 types of trace flags in SQL Server 2014: – global trace...
Tips for using SQL Server 2014 Database Console Commands
Tips for using SQL Server 2014 Database Console Commands Run DBCC commands during periods of low database access. Because DBCC commands usually are very resource effective, try to schedule them during CPU idle time and slow production periods. Use DBCC CHECKFILEGROUP instead of DBCC CHECKDB, if you need to check only specified filegroup, not entire database. If your database contains […]
Tips for using SQL Server 2014 Database Console Commands
Tips for using SQL Server 2014 Database Console Commands Run DBCC commands during periods of low database access. Because DBCC commands usually are very resource effective, try to schedule them during CPU idle time and slow production periods. Use DBCC CHECKFILEGROUP instead of DBCC CHECKDB, if you need to check only specified filegroup, not entire database. If your database contains...