Query plan generation improvement for some columnstore queries in SQL Server 2014 or 2016
When you run a query that has a table join for clustered columnstore tables, and the JOIN ON and the WHERE clauses refer to the same columns, SQL Server may not evaluate a hash join for the table join.
This issue occurs because the join keys are removed from the query tree during query normalization. By design, SQL Server doesn't generate a hash join plan for joins without join keys.
Cumulative Update informationThis improvement was introduced in the following cumulative update of SQL Server.
- Cumulative Update 1 for SQL Server 2016
- Cumulative Update 13 for SQL Server 2014
- Cumulative Update 7 for SQL Server 2014 SP1
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. We recommend that you download and install the latest cumulative updates for SQL Server:
To work around this issue, add the OPTION (HASH JOIN) hint to the query.
This cumulative update introduces that SQL Server evaluate a HASH join plan when a table join is performed for columnstore tables. Queries that access columnstore tables may benefit by hash join because hash join can be performed in batch mode.
To enable the improvement, add trace flag 2441 to the startup parameters or add OPTION (QUERYTRACE, 2441) to the query.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 3146123 - Last Review: 07/26/2016 08:45:00 - Revision: 4.0
Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Enterprise Core, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Business Intelligence, Microsoft SQL Server 2014 Web, Microsoft SQL Server 2016 Developer, Microsoft SQL Server 2016 Enterprise, Microsoft SQL Server 2016 Enterprise Core, Microsoft SQL Server 2016 Standard
- kbqfe kbsurveynew kbfix kbexpertiseadvanced KB3146123