Query plan generation improvement for some columnstore queries in SQL Server 2014 or 2016

Applies to: SQL Server 2014 DeveloperSQL Server 2014 DeveloperSQL Server 2014 Enterprise More

Symptoms


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.

Cause


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.

Resolution


Cumulative Update information

This improvement was introduced in the following cumulative update of SQL Server. 

Workaround


To work around this issue, add the OPTION (HASH JOIN) hint to the query.

More Information


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.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.