Sample Header Ad - 728x90

SQL Server cardinality hint

21 votes
4 answers
5278 views
Is there a way how to 'inject' a cardinality estimation to a SQL Server optimizer (any version)? i.e. something similar to Oracle's cardinality hint. My motivation is driven by the article, How Good Are Query Optimizers, Really? \[1] , where they test the influence of the cardinality estimator on a selection of a bad plan. Therefore, it would be sufficient if I could force the SQL Server to 'estimate' the cardinalities precisely for complex queries. --- \[1] Leis, Viktor, et al. "How good are query optimizers, really?" Proceedings of the VLDB Endowment 9.3 (2015): 204-215.
Asked by Radim Bača (233 rep)
Mar 31, 2017, 07:17 AM
Last activity: Aug 5, 2025, 12:16 PM