Tips for using table hints in SQL Server 2019 If your query is very slow, try the following before using table hints: – rebuild indexes used in the query (or defragment them using the DBCC INDEXDEFRAG command), – update statistics on the relevant tables, – consider creating new indexes for this query, – rewrite your query to provide better execution...
Tag: ROWLOCK
Tips for using table hints in SQL Server 2017
Tips for using table hints in SQL Server 2017 If you want to set any table hints, do not remember to test the query with hint and without the hint and compare results. Because SQL Server 2017 query optimizer usually proposes the best execution plan, you should test the query with table hint and use this hint only when it...
Some tips for using table hints in SQL Server 2016
Some tips for using table hints in SQL Server 2016 Use the INSERT … SELECT statement with the TABLOCK hint. In SQL Server 2016, the insert in an INSERT … SELECT statement is multi-threaded or can have a parallel plan. To get a parallel plan, you can use the compatibility level 130 and the INSERT … SELECT statement must use […]
Tips for using table hints in SQL Server 2014
Tips for using table hints in SQL Server 2014 One of the ways to increase the queries performance is using the SQL Server 2014 table hints. The table hints specify a locking method to be used by the query optimizer with this table, specify the locking granularity for a table, or one or more indexes to be used by the...
Tips for using SQL Server 2012 Table Hints
Tips for using SQL Server 2012 Table Hints One of the ways to increase the queries performance is using the SQL Server 2012 table hints. The table hints specify a locking method to be used by the query optimizer with this table, specify the locking granularity for a table, or one or more indexes to be used by the query...