/// <summary> /// Clones the options and sets the optimizer statistics package to the given value. /// </summary> /// <returns> /// A clone of the options with the updated optimizer statistics package. /// </returns> /// <remarks> /// <para>The parameter allows individual queries to pick different query /// optimizer statistics packages.</para> /// <para>Specifying "latest" as a value instructs Cloud Spanner to use the /// latest supported query optimizer statistics package. If not specified, /// Cloud Spanner uses the optimizer statistics package set at the database /// level options. Any other supported statistics package value overrides /// the default optimizer statistics package for query execution.</para> /// </remarks> /// <param name="optimizerStatisticsPackage">Optimizer statistics package to set.</param> public QueryOptions WithOptimizerStatisticsPackage(string optimizerStatisticsPackage) { var protoCopy = Proto.Clone(); protoCopy.OptimizerStatisticsPackage = optimizerStatisticsPackage; return(new QueryOptions(protoCopy)); }
/// <summary> /// Clones the options and sets the optimizer version to the given value. /// </summary> /// <returns> /// A clone of the options with the updated optimizer version. /// </returns> /// <remarks> /// <para>The parameter allows individual queries to pick different query /// optimizer versions.</para> /// <para>Specifying "latest" as a value instructs Cloud Spanner to use the /// latest supported query optimizer version. If not specified, Cloud Spanner /// uses optimizer version set at the database level options. Any other /// positive integer (from the list of supported optimizer versions) /// overrides the default optimizer version for query execution.</para> /// </remarks> /// <param name="optimizerVersion">Optimizer version to set.</param> public QueryOptions WithOptimizerVersion(string optimizerVersion) { var protoCopy = Proto.Clone(); protoCopy.OptimizerVersion = optimizerVersion; return(new QueryOptions(protoCopy)); }