Summary
When a query plan uses a batch-mode hash join where one of the inputs is an optimized bitmap filter with an underlying bookmark lookup or key lookup in Microsoft SQL Server 2016 and SQL Server 2017, inaccurate estimations are produced. This update improves the query performance for the scenario.
Resolution
This improvement is included in the following cumulative update for SQL Server:
Cumulative Update 6 for SQL Server 2017
Cumulative update 8 for SQL Server 2016 SP1
Note:
-
To enable this update at the server level, you must enable trace flag (TF) 4199. To enable TF 4199 globally, use the DBCC TRACEON (4199, -1) command or use –T 4199 as a startup parameter.
-
To enable this update at the database level, run the following command: ALTER DATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES=ON.
-
To enable this update at the query level, use the query hint: USE HINT('ENABLE_QUERY_OPTIMIZER_HOTFIXES').
Each new cumulative update for SQL Server contains all the hotfixes and security fixes that were in the previous build. Check out the latest cumulative update for SQL Server:
Status
Microsoft has confirmed that this is an improvement in the Microsoft products that are listed in the "Applies to" section.
References
Learn about the terminology that Microsoft uses to describe software updates.