n is either 1 or 0. The default is 0.
When ParameterSampling is enabled (n = 1), InterSystems SQL will save the complete set of query parameters when statements are prepared. This data is projected to INFORMATION_SCHEMA.STATEMENT_PARAMETER_STATS, which includes information on the efficiency of the query. Enabling parameter sampling can be useful for evaluating the efficacy of a schema, especially when testing a new schema.
Changing This Parameter
On the SQL page of the Management Portal (System Administration > Configuration > SQL and Object Settings > SQL), select Turn on parameter sampling to sample the parameter value for query execution to enable ParameterSampling.
To set the desired value for ParameterSampling from the InterSystems Terminal, use the SetOption(“ParameterSampling”)Opens in a new tab method of the %SYSTEM.SQL.UtilOpens in a new tab class. See the class reference for details.
You can also change ParameterSampling with the Config.SQLOpens in a new tab class (as described in the class reference) or by editing the CPF in a text editor (as described in the Editing the Active CPF section of the “Introduction to the Configuration Parameter File” chapter in this book).