[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-22 UTC."],[[["\u003cp\u003eThis webpage provides documentation for \u003ccode\u003eQueryOptions\u003c/code\u003e in the Google Cloud Spanner C++ client library, detailing its use in configuring SQL query execution on the server.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eQueryOptions\u003c/code\u003e documented is 2.37.0-rc, and the page offers access to documentation for versions ranging from 2.11.0 to 2.36.0, alongside a variety of older revisions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eQueryOptions\u003c/code\u003e can be constructed, assigned, and converted using various constructors and operators, including those for working with the \u003ccode\u003egoogle::cloud::Options\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eQueryOptions\u003c/code\u003e class allows users to manage settings like the optimizer version, statistics package, request priority, and request tag, with functions to get and set these properties.\u003c/p\u003e\n"],["\u003cp\u003eUsers can set the optimizer version to a specific integer string, the empty string to default to the database setting, or "latest" to use the most recent optimizer version.\u003c/p\u003e\n"]]],[],null,["# Class QueryOptions (2.13.0)\n\nVersion 2.13.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/spanner/latest/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.41.0](/cpp/docs/reference/spanner/2.41.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.40.0](/cpp/docs/reference/spanner/2.40.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.39.0](/cpp/docs/reference/spanner/2.39.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.38.0](/cpp/docs/reference/spanner/2.38.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.37.0](/cpp/docs/reference/spanner/2.37.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.36.0](/cpp/docs/reference/spanner/2.36.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.35.0](/cpp/docs/reference/spanner/2.35.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.34.0](/cpp/docs/reference/spanner/2.34.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.33.0](/cpp/docs/reference/spanner/2.33.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.32.0](/cpp/docs/reference/spanner/2.32.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.31.0](/cpp/docs/reference/spanner/2.31.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.30.0](/cpp/docs/reference/spanner/2.30.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.29.0](/cpp/docs/reference/spanner/2.29.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.28.0](/cpp/docs/reference/spanner/2.28.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.27.0](/cpp/docs/reference/spanner/2.27.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.26.0](/cpp/docs/reference/spanner/2.26.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.25.1](/cpp/docs/reference/spanner/2.25.1/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.24.0](/cpp/docs/reference/spanner/2.24.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.23.0](/cpp/docs/reference/spanner/2.23.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.22.1](/cpp/docs/reference/spanner/2.22.1/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.21.0](/cpp/docs/reference/spanner/2.21.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.20.0](/cpp/docs/reference/spanner/2.20.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.19.0](/cpp/docs/reference/spanner/2.19.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.18.0](/cpp/docs/reference/spanner/2.18.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.17.0](/cpp/docs/reference/spanner/2.17.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.16.0](/cpp/docs/reference/spanner/2.16.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.15.1](/cpp/docs/reference/spanner/2.15.1/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.14.0](/cpp/docs/reference/spanner/2.14.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.13.0](/cpp/docs/reference/spanner/2.13.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.12.0](/cpp/docs/reference/spanner/2.12.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions)\n- [2.11.0](/cpp/docs/reference/spanner/2.11.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions) \nThese [QueryOptions](/cpp/docs/reference/spanner/2.13.0/classgoogle_1_1cloud_1_1spanner_1_1QueryOptions) allow users to configure features about how their SQL queries executes on the server. \n\n###### See Also\n\n\u003chttps://cloud.google.com/spanner/docs/reference/rest/v1/QueryOptions\u003e\n\n###### See Also\n\n\u003chttp://cloud/spanner/docs/query-optimizer/manage-query-optimizer\u003e\n\nConstructors\n------------\n\n### QueryOptions()\n\n### QueryOptions(QueryOptions const \\&)\n\n### QueryOptions(QueryOptions \\&\\&)\n\n### QueryOptions(Options const \\&)\n\nConstructs from the new, recommended way to represent options of all varieties, [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html).\n\nOperators\n---------\n\n### operator=(QueryOptions const \\&)\n\n### operator=(QueryOptions \\&\\&)\n\n### operator Options() const\n\nConverts to the new, recommended way to represent options of all varieties, [`google::cloud::Options`](https://cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Options.html).\n\nFunctions\n---------\n\n### optimizer_version() const\n\nReturns the optimizer version.\n\n### set_optimizer_version(absl::optional\\\u003c std::string \\\u003e)\n\nSets the optimizer version to the specified integer string. \nSetting to the empty string will use the database default. Use the string \"latest\" to use the latest available optimizer version.\n\n### optimizer_statistics_package() const\n\nReturns the optimizer statistics package.\n\n### set_optimizer_statistics_package(absl::optional\\\u003c std::string \\\u003e)\n\nSets the optimizer statistics package to the specified string. \nSetting to the empty string will use the database default.\n\n### request_priority() const\n\nReturns the request priority.\n\n### set_request_priority(absl::optional\\\u003c RequestPriority \\\u003e)\n\nSets the request priority.\n\n### request_tag() const\n\nReturns the request tag.\n\n### set_request_tag(absl::optional\\\u003c std::string \\\u003e)\n\nSets the request tag."]]