Quantcast
Channel: Query Store Force Plan feature doesn't work - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Paul White for Query Store Force Plan feature doesn't work

$
0
0

From sys.query_store_plan (Transact-SQL) (emphasis added)

Plan forcing limitations

Query Store has a mechanism to enforce Query Optimizer to use certain execution plan. However, there are some limitations that can prevent a plan to be enforced.

First, if the plan contains following constructions:

  • Insert bulk statement.
  • Reference to an external table
  • Distributed query or full-text operations
  • Use of Global queries
  • Cursors
  • Invalid star join specification

You are using a cursor.


You can often force a cursor plan with a plan guide instead. See Using the USE PLAN Query Hint on Queries with Cursors.

And yes, I agree that the current situation does not make for the best user experience. I would expect that attempting to force a plan for something that cannot (currently) be forced would raise an error or warning, or log something. You could log a Feedback item to request an improvement in this area.


As of SQL 2019 CTP 2.3 forcing query execution plan for Fast Forward and Static cursors are supported

Query Store now supports the ability to force query execution plans for fast forward and static T-SQL and API cursors. Forcing is now supported via sp_query_store_force_plan or through SQL Server Management Studio Query Store reports.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>