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.
This improvement is included in the following cumulative update for SQL Server:
- 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').
Microsoft has confirmed that this is an improvement in the Microsoft products that are listed in the "Applies to" section.