We are running
Microsoft SQL Server 2022 Enterprise edition version 16.0.4115.5 (X64)
SQL Server has 254 Cores, 7.5 TB RAM dedicated for SQL Server
SQL Server is running in HA cluster -1 primary and 3 secondary replicas (1 synchronous, 2 asynchronous commit)
Number of databases on the SQL Server are 166.
Query store is enabled in all our databases and configured with default values via Microsoft recommendations (meaning documentation) in primary replica only. Exception is MAX_STORAGE_SIZE_MB which is set to approprite value for every database.
Query store on many databases has started automatically switching to READ_ONLY mode and back to READ_WRITE after we installed SQL Server 2022. Switching to READ_ONLY mode is due to readonly_reason= 262144 (i.e. query store internal memory limit was reached).
We tried to find some information about the query store internal memory limit, but there isn't any information about value of the limit value and how this can be increased. We found only information that this value of memory limit can be automatically set by SQL Server engine and changed in according to server size of memory.
The situation on many databases is rather problematic for us, because switching to READ_ONLY mode is depend on the database load and amount of queries. Some of the most heavily loaded databases are switched to READ_ONLY mode practically forever. With this new feature of Query Store, we practically lost information about the queries running there mainly on our most important databases.
Are there any possibilities how to prevent query store automatically switched to READ_ONLY mode due to the reason 262144?