[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-21 UTC。"],[],[],null,["# Use the BigQuery advanced runtime\n=================================\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** To provide feedback or request support for this feature, send email to [bqarfeedback@google.com](mailto:bqarfeedback@google.com).\n\nThis document describes how to enable and disable the BigQuery\nadvanced runtime, and how to evaluate the advanced runtime's effects on your\nquery performance.\n\nRoles and permissions\n---------------------\n\n\nTo get the permissions that\nyou need to specify a configuration setting,\n\nask your administrator to grant you the\n\n\n[BigQuery Admin](/iam/docs/roles-permissions/bigquery#bigquery.admin) (`roles/bigquery.admin`)\nIAM role on your project or organization.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nFeatures\n--------\n\nEnabling the advanced runtime on a BigQuery project turns on\nfeatures in the query processor that reduce query latency and slot consumption\nat no additional cost.\n\n### Enhanced vectorization\n\nVectorized execution is a query processing model that operates on columns of\ndata in blocks that align with CPU cache size and uses\nsingle instruction, multiple data (SIMD) instructions. Enhanced vectorization\nextends the vectorized query execution in BigQuery to\nthe following aspects of query processing:\n\n- By leveraging specialized data encodings within the Capacitor storage format, filter evaluation operations can be executed on the encoded data.\n- Specialized encodings are propagated through the query plan, which allows more data to be processed while it's still encoded.\n- By implementing expression folding to evaluate deterministic functions and constant expressions, BigQuery can simplify complex predicates into constant values.\n\n### Short query optimizations\n\nBigQuery typically executes queries in a distributed environment\nusing a shuffle intermediate layer. Short query optimizations\ndynamically identify queries that can be run as a\nsingle stage, reducing latency and slot consumption. Specialized encodings can\nbe used more effectively when a query is run in a single stage.\nThese optimizations are most effective when used with\n[optional job creation mode](/bigquery/docs/running-queries#optional-job-creation),\nwhich minimizes job startup, maintenance, and result retrieval latency.\n\nEligibility for short query optimization is dynamic and influenced by\nthe following factors:\n\n- The predicted size of the data scan.\n- The amount of data movement required.\n- The selectivity of query filters.\n- The type and physical layout of the data in storage.\n- The overall query structure.\n- The [historical statistics](/bigquery/docs/history-based-optimizations) of past query executions.\n\nEnable the advanced runtime\n---------------------------\n\nTo enable the advanced runtime for your project or organization, use the\n[`ALTER PROJECT`](/bigquery/docs/reference/standard-sql/data-definition-language#alter_project_set_options_statement)\nor\n[`ALTER ORGANIZATION`](/bigquery/docs/reference/standard-sql/data-definition-language#alter_organization_set_options_statement)\nstatement to change the\n[default configuration](/bigquery/docs/default-configuration). In the\nstatement, set the `query_runtime` argument to `'advanced'`. For example: \n\n ALTER PROJECT \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e\n SET OPTIONS (\n `region-\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e.query_runtime` = 'advanced'\n );\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the project\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the project\n\nIt can take several minutes for the change to take effect.\n\nOnce you've enabled the advanced runtime, qualifying queries in the project or organization\nuse the advanced runtime regardless of which user created the\nquery job.\n\nDisable the advanced runtime\n----------------------------\n\nTo disable the advanced runtime for your project or organization, use the\n`ALTER PROJECT` or `ALTER ORGANIZATION` statement to change the\n[default configuration](/bigquery/docs/default-configuration). In the\nstatement, set the `query_runtime` argument to `NULL`. For example: \n\n ALTER PROJECT \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e\n SET OPTIONS (\n `region-\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e.query_runtime` = NULL\n );\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of the project\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the project\n\nIt can take several minutes for the change to take effect.\n\nEvaluate query performance\n--------------------------\n\nYou can use the\n[administrative job explorer](/bigquery/docs/admin-jobs-explorer) and\n[`INFORMATION_SCHEMA` views](/bigquery/docs/information-schema-intro) to\nevaluate the effect of the advanced runtime on query execution time and slot\nusage.\n\nFollow these steps to evaluate query performance with and without the\nadvanced runtime enabled:\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. Open a new tab in the query editor.\n\n3. [Disable the use of cached query results](/bigquery/docs/cached-results#disabling_retrieval_of_cached_results)\n for that query tab.\n\n4. Type or copy your test queries into the query tab.\n\n5. Run your test queries a few times to establish baseline performance.\n After each run, determine the query performance metrics as follows:\n\n 1. [View the query execution details](/bigquery/docs/admin-jobs-explorer#view_query_execution_details) in the administrative job explorer.\n 2. Retrieve job performance data from the\n [`INFORMATION_SCHEMA.JOBS_BY_USER` view](/bigquery/docs/information-schema-jobs-by-user)\n by running the following query in a new query tab:\n\n SELECT\n job_id,\n end_time - start_time AS duration,\n total_slot_ms,\n query\n FROM\n `region-us`.INFORMATION_SCHEMA.JOBS_BY_USER\n WHERE\n creation_time \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND job_type='QUERY'\n AND total_slot_ms IS NOT NULL\n ORDER BY\n creation_time DESC,\n query ASC\n LIMIT 1000;\n\n6. [Enable the advanced runtime](#enable-advanced-runtime).\n\n7. Repeat Step 5.\n\n8. Compare the query latency and slot usage metrics for the test queries\n from before and after you enabled the advanced runtime."]]